discourse/spec/system/page_objects/modals/discard_draft.rb
Joffrey JAFFEUX bbe62d88d2
FIX: prevents showing discard modal on re-edit (#26639)
This commit will now change two behaviors:

- If composer is already opened on a specific post and we click on edit again for the same post, we will do nothing and not show the discard draft modal
- if composer is shrinked and we click on edit for the same currently edited post, we will just open the composer and not show the discard draft modal
2024-04-16 10:34:32 +02:00

17 lines
343 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
end
end
end