mirror of
https://github.com/discourse/discourse.git
synced 2026-08-17 16:35:03 -05:00
DEV: makes chat modals use the new <DModal /> component (#22495)
This commit also standardize the naming pattern of modals: `<Chat::Modal::FooBar />` and changes css class accordingly. Co-authored-by: David Taylor <david@taylorhq.com>
This commit is contained in:
co-authored by
David Taylor
parent
ed2dae6d1a
commit
9830c40386
@@ -97,12 +97,12 @@ RSpec.describe "Channel - Info - About page", type: :system do
|
||||
find(".edit-description-btn").click
|
||||
|
||||
expect(page).to have_selector(
|
||||
".chat-channel-edit-description-modal__description-input",
|
||||
".chat-modal-edit-channel-description__description-input",
|
||||
text: channel_1.description,
|
||||
)
|
||||
|
||||
description = "A new description"
|
||||
find(".chat-channel-edit-description-modal__description-input").fill_in(with: description)
|
||||
find(".chat-modal-edit-channel-description__description-input").fill_in(with: description)
|
||||
find(".create").click
|
||||
|
||||
expect(page).to have_content(description)
|
||||
|
||||
@@ -33,7 +33,7 @@ RSpec.describe "Summarize a channel since your last visit", type: :system, js: t
|
||||
find(".chat-composer-dropdown__trigger-btn").click
|
||||
find(".chat-composer-dropdown__action-btn.channel-summary").click
|
||||
|
||||
expect(page.has_css?(".channel-summary-modal", wait: 5)).to eq(true)
|
||||
expect(page.has_css?(".chat-modal-channel-summary")).to eq(true)
|
||||
|
||||
find(".summarization-since").click
|
||||
find(".select-kit-row[data-value=\"3\"]").click
|
||||
|
||||
@@ -148,7 +148,7 @@ RSpec.describe "Create channel", type: :system do
|
||||
context "for a public category" do
|
||||
before do
|
||||
channel_modal.select_category(category_1)
|
||||
find(".-auto-join .create-channel__label").click
|
||||
find(".-auto-join .chat-modal-create-channel__label").click
|
||||
channel_modal.click_primary_button
|
||||
end
|
||||
|
||||
@@ -172,7 +172,7 @@ RSpec.describe "Create channel", type: :system do
|
||||
|
||||
it "does nothing if no is clicked" do
|
||||
dialog.click_no
|
||||
expect(page).to have_css(".create-channel-modal")
|
||||
expect(page).to have_css(".chat-modal-create-channel")
|
||||
expect(Chat::Channel.exists?(chatable_id: category_1.id)).to eq(false)
|
||||
end
|
||||
end
|
||||
@@ -185,7 +185,7 @@ RSpec.describe "Create channel", type: :system do
|
||||
before do
|
||||
group_1.add(user_1)
|
||||
channel_modal.select_category(private_category)
|
||||
find(".-auto-join .create-channel__label").click
|
||||
find(".-auto-join .chat-modal-create-channel__label").click
|
||||
channel_modal.click_primary_button
|
||||
end
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ RSpec.describe "Move message to channel", type: :system do
|
||||
chat_page.visit_channel(channel_1)
|
||||
channel_page.messages.select(message_1)
|
||||
channel_page.selection_management.move
|
||||
find(".chat-move-message-channel-chooser").click
|
||||
find(".chat-modal-move-message-to-channel__channel-chooser").click
|
||||
find("[data-value='#{channel_2.id}']").click
|
||||
click_button(I18n.t("js.chat.move_to_channel.confirm_move"))
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ module PageObjects
|
||||
|
||||
def open_new_message
|
||||
send_keys([PLATFORM_KEY_MODIFIER, "k"])
|
||||
find(".chat-new-message-modal")
|
||||
find(".chat-modal-new-message")
|
||||
end
|
||||
|
||||
def has_drawer?(channel_id: nil, expanded: true)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
module PageObjects
|
||||
module Pages
|
||||
class ChatChannelAbout < PageObjects::Pages::Base
|
||||
EDIT_MODAL_SELECTOR = ".chat-channel-edit-name-slug-modal"
|
||||
EDIT_MODAL_SELECTOR = ".chat-modal-edit-channel-name"
|
||||
|
||||
def open_edit_modal
|
||||
click_button(class: "edit-name-slug-btn")
|
||||
|
||||
@@ -6,7 +6,7 @@ module PageObjects
|
||||
class MessageCreator < PageObjects::Components::Base
|
||||
attr_reader :context
|
||||
|
||||
SELECTOR = ".chat-new-message-modal"
|
||||
SELECTOR = ".chat-modal-new-message"
|
||||
|
||||
def component
|
||||
find(SELECTOR)
|
||||
|
||||
@@ -9,11 +9,11 @@ module PageObjects
|
||||
end
|
||||
|
||||
def create_channel_hint
|
||||
find(".create-channel__hint")
|
||||
find(".chat-modal-create-channel__hint")
|
||||
end
|
||||
|
||||
def slug_input
|
||||
find(".-slug .create-channel__input")
|
||||
find(".-slug .chat-modal-create-channel__input")
|
||||
end
|
||||
|
||||
def has_create_hint?(content)
|
||||
@@ -21,23 +21,23 @@ module PageObjects
|
||||
end
|
||||
|
||||
def has_threading_toggle?
|
||||
has_selector?(".create-channel__control.-threading-toggle")
|
||||
has_selector?(".chat-modal-create-channel__control.-threading-toggle")
|
||||
end
|
||||
|
||||
def fill_name(name)
|
||||
fill_in("channel-name", with: name)
|
||||
fill_in("name", with: name)
|
||||
end
|
||||
|
||||
def fill_slug(slug)
|
||||
fill_in("channel-slug", with: slug)
|
||||
fill_in("slug", with: slug)
|
||||
end
|
||||
|
||||
def fill_description(description)
|
||||
fill_in("channel-description", with: description)
|
||||
fill_in("description", with: description)
|
||||
end
|
||||
|
||||
def has_name_prefilled?(name)
|
||||
has_field?("channel-name", with: name)
|
||||
has_field?("name", with: name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -150,7 +150,7 @@ describe "Thread list in side panel | full page", type: :system do
|
||||
open_thread_list
|
||||
thread_list_page.item_by_id(thread_1.id).click
|
||||
thread_page.header.open_settings
|
||||
find(".thread-title-input").fill_in(with: new_title)
|
||||
find(".chat-modal-thread-settings__title-input").fill_in(with: new_title)
|
||||
find(".modal-footer .btn-primary").click
|
||||
expect(thread_page.header).to have_title_content(new_title)
|
||||
end
|
||||
@@ -161,7 +161,7 @@ describe "Thread list in side panel | full page", type: :system do
|
||||
open_thread_list
|
||||
thread_list_page.item_by_id(thread_1.id).click
|
||||
thread_page.header.open_settings
|
||||
find(".thread-title-input").fill_in(with: new_title)
|
||||
find(".chat-modal-thread-settings__title-input").fill_in(with: new_title)
|
||||
find(".modal-footer .btn-primary").click
|
||||
expect(thread_page.header).to have_title_content(new_title)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user