discourse/spec/system/page_objects/components/fast_editor.rb
David Battersby 0a619d8c88
FIX: Fast edit doesn’t work on content with certain characters (#20410)
Small js fix for fast edit to allow posts to save changes when the post contains apostrophes and quotation marks. Replaces unicode characters in text prior to saving the edit.

Includes system tests for fast edit and introduces a new system spec component for fast edit usage.
2023-02-23 11:30:16 +08:00

29 lines
521 B
Ruby

# frozen_string_literal: true
module PageObjects
module Components
class FastEditor < PageObjects::Components::Base
def fill_content(content)
fast_edit_input.fill_in(with: content)
self
end
def clear_content
fill_content("")
end
def has_content?(content)
fast_edit_input.value == content
end
def save
find(".save-fast-edit").click
end
def fast_edit_input
find("#fast-edit-input")
end
end
end
end