discourse/spec/system/page_objects/modals/discard_draft.rb
David Battersby 47c8197ea1
FEATURE: add drafts dropdown menu (#30277)
This change adds a new dropdown trigger next to the "New Topic" button.
When clicked a menu will display a list of topic/post drafts that can be
clicked to resume the draft within the composer.

The "New Topic" button will no longer change text to show "Open Draft"
when a draft topic exists, it will still attempt to load the existing
draft if one exists (this will change later when we support multiple
drafts in a separate PR).

The "My Posts" link in desktop sidebar will now be "My Drafts" and only
appear when the current user has existing drafts.
2025-01-13 13:33:57 +04:00

25 lines
507 B
Ruby

# frozen_string_literal: true
module PageObjects
module Modals
class DiscardDraft < PageObjects::Modals::Base
MODAL_SELECTOR = ".discard-draft-modal"
def open?
has_css?(".modal.d-modal#{MODAL_SELECTOR}")
end
def closed?
has_no_css?(".modal.d-modal#{MODAL_SELECTOR}")
end
def click_save
footer.find("button.save-draft").click
end
def click_discard
footer.find("button.discard-draft").click
end
end
end
end