diff --git a/src/clj/rems/db/test_data.clj b/src/clj/rems/db/test_data.clj index 45b63f9938..e4599768eb 100644 --- a/src/clj/rems/db/test_data.clj +++ b/src/clj/rems/db/test_data.clj @@ -523,6 +523,34 @@ :auto-approve auto-approve :organization-owner organization-owner})) +(defn- create-bonafide-catalogue-item! [users] + (let [owner (:owner users) + bot (:bonafide-bot users) + res (create-resource! {:resource-ext-id "bonafide" + :organization {:organization/id "default"} + :actor owner}) + form (create-form! {:actor owner + :form/title "Bona Fide form" + :organization {:organization/id "default"} + :form/fields [{:field/type :email + :field/title {:fi "Suosittelijan sähköpostiosoite" + :en "Referer's email address" + :sv "sv"} + :field/optional false}]}) + wf (create-workflow! {:actor owner + :organization {:organization/id "default"} + :title "Bona Fide workflow" + :type :workflow/default + :handlers [bot]})] + (create-catalogue-item! {:actor owner + :organization {:organization/id "default"} + :title {:en "Apply for Bona Fide researcher status" + :fi "Hae Bona Fide tutkija -statusta" + :sv "sv"} + :resource-id res + :form-id form + :workflow-id wf}))) + (defn- create-disabled-applications! [catid applicant approver] (create-draft! applicant [catid] "draft with disabled item") @@ -937,6 +965,7 @@ :form-id form :organization {:organization/id "nbn"} :workflow-id (:auto-approve workflows)}) + (create-bonafide-catalogue-item! (merge users +bot-users+)) (let [thl-res (create-resource! {:resource-ext-id "thl" :organization {:organization/id "thl"} :actor owner}) diff --git a/src/clj/rems/db/test_data_users.clj b/src/clj/rems/db/test_data_users.clj index 2c31ab6cb8..1f91d1ea13 100644 --- a/src/clj/rems/db/test_data_users.clj +++ b/src/clj/rems/db/test_data_users.clj @@ -1,15 +1,18 @@ (ns rems.db.test-data-users (:require [clojure.test :refer :all] [rems.application.approver-bot :as approver-bot] + [rems.application.bonafide-bot :as bonafide-bot] [rems.application.rejecter-bot :as rejecter-bot] [rems.testing-util :refer [with-user]])) (def +bot-users+ {:approver-bot approver-bot/bot-userid + :bonafide-bot bonafide-bot/bot-userid :rejecter-bot rejecter-bot/bot-userid}) (def +bot-user-data+ {approver-bot/bot-userid {:eppn approver-bot/bot-userid :commonName "Approver Bot"} + bonafide-bot/bot-userid {:eppn bonafide-bot/bot-userid :commonName "Bona Fide Bot"} rejecter-bot/bot-userid {:eppn rejecter-bot/bot-userid :commonName "Rejecter Bot"}}) (def +fake-users+