Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pkoivisto committed Feb 21, 2025
1 parent 594e1eb commit 19d227b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions test/yki/handler/evaluation_payment_new_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@
kirjaamo-email (pgq/take email-q)
exam-date (base/two-weeks-ago)]
(testing "Emails are sent to customer and kirjaamo after successful payment"
(is (= {:recipients ["[email protected]"]
(is (= {:recipients [{:email "[email protected]"
:name "Anne Marie Jones"}]
:subject (str/join ", " ["Yleiset kielitutkinnot (YKI), tarkistusarviointipyyntö: Suomi perustaso" (format-date-string-to-finnish-format exam-date)])}
(select-keys customer-email [:recipients :subject])))
(testing "Customer email has PDF receipt as attachment"
Expand All @@ -140,7 +141,7 @@
(is (= (without-empty-lines (:data receipt-attachment))
(without-empty-lines (parser/render-file "evaluation_payment_receipt_template.html" {:current_date (t/now)
:exam_date exam-date}))))))
(is (= {:recipients ["[email protected]"]
(is (= {:recipients [{:email "[email protected]"}]
:subject (str/join ", " ["YKI" "Suomi perustaso" (format-date-string-to-finnish-format exam-date)])}
(select-keys kirjaamo-email [:recipients :subject])))))
(testing "Once payment is marked as PAID, later callback invocations do not change the status"
Expand Down
2 changes: 1 addition & 1 deletion test/yki/handler/login_link_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
(is (= (:status response) 200))
(testing "email send request should be send to job queue"
(is (= (:subject email-request) "Ilmoittautuminen (YKI): Suomi perustaso - Omenia, 27.1.2018"))
(is (= (:recipients email-request) ["[email protected]"])))))
(is (= (:recipients email-request) [{:email "[email protected]"}])))))
(testing "login link should not be created if exam session isn't open for registration"
(base/execute! "UPDATE exam_date SET registration_start_date='2039-01-01' WHERE id IN (SELECT exam_date_id FROM exam_session WHERE id=1);")
(let [request-data {:email "[email protected]"
Expand Down
4 changes: 3 additions & 1 deletion test/yki/registration/email_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
(send-exam-registration-completed-email! email-q pdf-renderer "fi" registration-data payment-data)
(let [{:keys [recipients attachments]} (pgq/take email-q)]
(testing "Confirmation email is sent to correct recipient"
(is (= ["[email protected]"] recipients)))
(is (= [{:email "[email protected]"
:name "Teijo Antero Testitapaus"}]
recipients)))
(testing "Attachments contains a PDF receipt"
(is (= 1 (count attachments)))
(let [attachment-data (first attachments)
Expand Down

0 comments on commit 19d227b

Please sign in to comment.