I'm working on a cypress test that toggles a checkbox that toggles items which causes the button to appear and it click the button. The test itself works as intended for when there are items togglable. The case when there aren't any items that can be toggled, the assertion fails because the button doesn't show up. How would I write a test where it check if the button shows up after something is toggled or else log something when it doesn't appear.
The conditional doesn't actually work as it always hit hit the if even if the button doesnt exist so I'm sure that my if statement itself is wrong.