discourse/spec/system/page_objects/modals/discard_draft.rb
Yuriy Kurant 98f4e00f0d
UX: Simplify Composer Discard confirmation dialog: removes Safe draft button (#35298)
This change simplifies controls of confirmation dialog when post is discarded in composer:
* `Discard` button stays unchanged
* `Save draft for later` button is removed
* `Keep editing` button is renamed to `Cancel` (functionality is
unchanged)
* changes modal copy from `What would you like to do with your post?` to
`Do you want to discard your post?`

|Before|After|
|---|---|
|<img width="614" height="138" alt="Screenshot 2025-10-10 at 13 18 06"
src="https://github.com/user-attachments/assets/76be21fa-c9d9-4c1d-9cb2-079d87d0e913"
/>|<img width="618" height="142" alt="Screenshot 2025-10-10 at 13 09 40"
src="https://github.com/user-attachments/assets/b106a6f0-e420-4351-8785-cb69ee587a49"
/>|

NOTE: do not mind the design on screenshots (dark/light mode). They
showcase change in controls. This PR doesn't change UI.
2025-10-10 14:07:34 +08:00

24 lines
537 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_discard
footer.find(".discard-draft-modal__discard-btn").click
end
def click_cancel
footer.find(".discard-draft-modal__cancel-btn").click
end
end
end
end