Add tests for the hidden/flagged buttons

This commit is contained in:
swagg boi 2023-01-09 21:34:34 -05:00
parent b685388289
commit 936ec902b5
2 changed files with 4 additions and 1 deletions

View file

@ -33,7 +33,6 @@ Run the tests locally (against development environment):
## TODOs ## TODOs
1. Actions for creating moderators and resetting passwords 1. Actions for creating moderators and resetting passwords
1. Probably tests for that 'hidden' button
1. CSS 1. CSS
1. "All new posts flagged" mode (require approval for new posts) 1. "All new posts flagged" mode (require approval for new posts)

View file

@ -80,12 +80,16 @@ subtest Login => sub {
$t->get_ok('/moderator/flagged') $t->get_ok('/moderator/flagged')
->status_is(200) ->status_is(200)
->text_like(h2 => qr/Flagged Posts/) ->text_like(h2 => qr/Flagged Posts/)
->element_exists('a[href*="/moderator/flagged"]')
->element_exists('a[href*="/moderator/hidden"]' )
}; };
subtest Hidden => sub { subtest Hidden => sub {
$t->get_ok('/moderator/hidden') $t->get_ok('/moderator/hidden')
->status_is(200) ->status_is(200)
->text_like(h2 => qr/Hidden Posts/) ->text_like(h2 => qr/Hidden Posts/)
->element_exists('a[href*="/moderator/flagged"]')
->element_exists('a[href*="/moderator/hidden"]' )
}; };
# Mod session ends # Mod session ends