From 936ec902b5ca381b42740e77cc5d04eb6089a3b7 Mon Sep 17 00:00:00 2001 From: swag Date: Mon, 9 Jan 2023 21:34:34 -0500 Subject: [PATCH] Add tests for the hidden/flagged buttons --- README.md | 1 - t/moderator.t | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1011a16..6283a75 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,6 @@ Run the tests locally (against development environment): ## TODOs 1. Actions for creating moderators and resetting passwords -1. Probably tests for that 'hidden' button 1. CSS 1. "All new posts flagged" mode (require approval for new posts) diff --git a/t/moderator.t b/t/moderator.t index 8ae7f02..4a7c76a 100644 --- a/t/moderator.t +++ b/t/moderator.t @@ -80,12 +80,16 @@ subtest Login => sub { $t->get_ok('/moderator/flagged') ->status_is(200) ->text_like(h2 => qr/Flagged Posts/) + ->element_exists('a[href*="/moderator/flagged"]') + ->element_exists('a[href*="/moderator/hidden"]' ) }; subtest Hidden => sub { $t->get_ok('/moderator/hidden') ->status_is(200) ->text_like(h2 => qr/Hidden Posts/) + ->element_exists('a[href*="/moderator/flagged"]') + ->element_exists('a[href*="/moderator/hidden"]' ) }; # Mod session ends