mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-24 02:41:20 +08:00
Fixes an issue where a URL like this: ``` https://meta.discourse.org/admin/site_settings/category/all_results?filter=discourse connect ``` Would appear to be broken when inserting into the composer via the hyperlink modal. All we have to do is escape it before inserting, and unescape before editing it in the modal. Also in this commit I am renaming the InsertHyperlink modal to UpsertHyperlink, since it is used for both inserting and editing links.
27 lines
694 B
Ruby
Vendored
27 lines
694 B
Ruby
Vendored
# frozen_string_literal: true
|
|
module PageObjects
|
|
module Modals
|
|
class UpsertHyperlink < PageObjects::Modals::Base
|
|
BODY_SELECTOR = ".upsert-hyperlink-modal"
|
|
MODAL_SELECTOR = ".upsert-hyperlink-modal"
|
|
LINK_TEXT_SELECTOR = ".d-modal__body input.link-text"
|
|
LINK_URL_SELECTOR = ".d-modal__body input.link-url"
|
|
|
|
def fill_in_link_text(text)
|
|
find(LINK_TEXT_SELECTOR).fill_in(with: text)
|
|
end
|
|
|
|
def fill_in_link_url(url)
|
|
find(LINK_URL_SELECTOR).fill_in(with: url)
|
|
end
|
|
|
|
def link_text_value
|
|
find(LINK_TEXT_SELECTOR).value
|
|
end
|
|
|
|
def link_url_value
|
|
find(LINK_URL_SELECTOR).value
|
|
end
|
|
end
|
|
end
|
|
end
|