discourse/plugins/chat/spec/system/channel_info_pages_spec.rb
Alan Guo Xiang Tan 41f8bff2c3
DEV: Remove superfluous js: true metadata (#21960)
Why this change?

It is very unlikely that we need to ever JS for system tests considering
that we rely on a JS framework on the frontend.
2023-06-07 09:26:58 +08:00

39 lines
1.1 KiB
Ruby

# frozen_string_literal: true
RSpec.describe "Info pages", type: :system do
let(:chat_page) { PageObjects::Pages::Chat.new }
let(:channel) { PageObjects::Pages::ChatChannel.new }
fab!(:current_user) { Fabricate(:user) }
fab!(:channel_1) { Fabricate(:chat_channel) }
before do
chat_system_bootstrap
channel_1.add(current_user)
sign_in(current_user)
end
context "when visiting from browse page" do
context "when clicking back button" do
it "redirects to browse page" do
chat_page.visit_browse
find(".chat-channel-card__setting").click
find(".chat-full-page-header__back-btn").click
expect(page).to have_current_path("/chat/browse/open")
end
end
end
context "when visiting from channel page" do
context "when clicking back button" do
it "redirects to channel page" do
chat_page.visit_channel(channel_1)
find(".chat-channel-title-wrapper").click
find(".chat-full-page-header__back-btn").click
expect(page).to have_current_path(chat.channel_path(channel_1.slug, channel_1.id))
end
end
end
end