discourse/spec/system/page_objects/modals/dismiss_new.rb
Kris df1bede9f7
FIX: when new new is enabled, filter dismiss modal to correct type (#33037)
Currently both boxes are always checked, even if you're filtered to new
topics or new posts.

You must have the site setting `Experimental new new view groups` set to
your user's group to see this mode.



![image](https://github.com/user-attachments/assets/f485ad66-7491-4f52-a812-4b5f9dba6d63)

This allows both options to appear, but only selects the current filter:


![image](https://github.com/user-attachments/assets/6a3c1a91-1638-440f-80e3-4d74711d8064)

Turns out this was already implemented, but `subset` was always
undefined. This fixes the arg and adds a couple new specs to cover it.

see /t/155039 for reference
2025-06-03 09:47:06 -04:00

36 lines
818 B
Ruby

# frozen_string_literal: true
module PageObjects
module Modals
class DismissNew < PageObjects::Modals::Base
def has_dismiss_topics_checked?
find(".dismiss-topics label").has_checked_field?
end
def has_dismiss_posts_checked?
find(".dismiss-posts label").has_checked_field?
end
def has_dismiss_topics_unchecked?
find(".dismiss-topics label").has_no_checked_field?
end
def has_dismiss_posts_unchecked?
find(".dismiss-posts label").has_no_checked_field?
end
def has_untrack_unchecked?
find(".untrack label").has_no_checked_field?
end
def click_dismiss
click_button("dismiss-read-confirm")
self
end
def closed?
page.has_no_css?(".d-modal")
end
end
end
end