Moar tests

This commit is contained in:
swagg boi 2022-12-08 16:10:11 -06:00
parent 75381754d4
commit f6eb0dfc05
2 changed files with 20 additions and 5 deletions

View file

@ -32,7 +32,6 @@ Run the tests locally (against development environment):
## TODOs ## TODOs
1. Tests for flagged view? Not much to it but got pulled into work stuff
1. View for hidden posts 1. View for hidden posts
1. Actions for creating moderators and resetting passwords 1. Actions for creating moderators and resetting passwords
1. CSS 1. CSS

View file

@ -31,10 +31,6 @@ subtest Login => sub {
->status_is(302) ->status_is(302)
->header_like(Location => qr{moderator/flagged}); ->header_like(Location => qr{moderator/flagged});
$t->get_ok('/moderator/flagged')
->status_is(200)
->text_like(h2 => qr/Flagged Posts/);
$t->get_ok('/login') $t->get_ok('/login')
->status_is(302) ->status_is(302)
->header_like(Location => qr{moderator/flagged}); ->header_like(Location => qr{moderator/flagged});
@ -80,6 +76,18 @@ subtest Login => sub {
->element_exists('a[href*="/unflag/1"]'); ->element_exists('a[href*="/unflag/1"]');
}; };
subtest Flagged => sub {
$t->get_ok('/moderator/flagged')
->status_is(200)
->text_like(h2 => qr/Flagged Posts/)
};
#subtest Hidden => sub {
# $t->get_ok('/moderator/hidden')
# ->status_is(200)
# ->text_like(h2 => qr/Hidden Posts/)
#};
# Mod session ends # Mod session ends
$t->get_ok('/logout') $t->get_ok('/logout')
->status_is(302) ->status_is(302)
@ -97,6 +105,14 @@ subtest Login => sub {
->element_exists_not('a[href*="/hide/1"]' ) ->element_exists_not('a[href*="/hide/1"]' )
->element_exists_not('a[href*="/unhide/1"]') ->element_exists_not('a[href*="/unhide/1"]')
->element_exists_not('a[href*="/unflag/1"]'); ->element_exists_not('a[href*="/unflag/1"]');
$t->get_ok('/moderator/flagged')
->status_is(302)
->header_like(Location => qr/login/);
#$t->get_ok('/moderator/hidden')
# ->status_is(302)
# ->header_like(Location => qr/login/);
}; };
}; };