From 978d0d629b9848a9418bc254ad1164e382c25924 Mon Sep 17 00:00:00 2001 From: Shish Date: Fri, 7 Jun 2024 14:48:34 +0100 Subject: [PATCH] [terms] add tests --- ext/terms/test.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 ext/terms/test.php diff --git a/ext/terms/test.php b/ext/terms/test.php new file mode 100644 index 00000000..3b23743e --- /dev/null +++ b/ext/terms/test.php @@ -0,0 +1,27 @@ +request('GET', 'post/list', cookies: []); + $this->assert_text("terms-modal-enter"); + } + + public function testLoggedIn(): void + { + $this->log_in_as_user(); + $this->request('GET', 'post/list', cookies: []); + $this->assert_no_text("terms-modal-enter"); + } + + public function testCookie(): void + { + $this->request('GET', 'post/list', cookies: ['shm_accepted_terms' => 'true']); + $this->assert_no_text("terms-modal-enter"); + } +}