Martin Brennan b5d42f373b
DEV: Re-introduce proofreading specs (#1263)
Followup fe7e73a6a436795c053a611884431f663f4bdd27 and
1300cc8a36dc33870f0d3c81e1e1a21a93e1f1de

Reintroduces proofreader specs and unskips ones skipped when
streaming composer suggestions were added. We just need to make sure
the jobs run immediately in specs because the job is what sends the
MessageBus event to the UI.

Also adds a pageobject method to confirm a diff is shown
in the modal before pressing Confirm button.
2025-04-16 11:11:43 +10:00

33 lines
765 B
Ruby

# frozen_string_literal: true
module PageObjects
module Modals
class DiffModal < PageObjects::Modals::Base
def visible?
page.has_css?(".composer-ai-helper-modal", wait: 5)
end
def confirm_changes
find(".d-modal__footer button.confirm", wait: 5).click
end
def discard_changes
find(".d-modal__footer button.discard", wait: 5).click
end
def old_value
find(".composer-ai-helper-modal__old-value").text
end
def new_value
find(".composer-ai-helper-modal__new-value").text
end
def has_diff?(old_value, new_value)
has_css?(".inline-diff ins", text: new_value) &&
has_css?(".inline-diff del", text: old_value)
end
end
end
end