discourse/plugins/chat/spec/system/drawer/index_spec.rb
chapoi d0427919f1
UX: add illustrations for empty chat list + split into tabs on drawer (#26910)
Adds a placeholder image + CTA in chat, for empty channel and DM lists.

On desktop with drawer mode, we split chat into tabs (like mobile).

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
Co-authored-by: David Battersby <info@davidbattersby.com>
Co-authored-by: Régis Hanol <regis@hanol.fr>
2024-05-28 17:00:04 +04:00

46 lines
1002 B
Ruby

# frozen_string_literal: true
RSpec.describe "Drawer - index", type: :system do
fab!(:current_user) { Fabricate(:user) }
let(:drawer_page) { PageObjects::Pages::ChatDrawer.new }
before do
chat_system_bootstrap
sign_in(current_user)
end
it "can leave a direct message" do
channel = Fabricate(:direct_message_channel, users: [current_user])
row = PageObjects::Components::Chat::ChannelRow.new(channel.id)
drawer_page.visit_index
drawer_page.click_direct_messages
expect(row).to exist
row.leave
expect(row).to be_non_existent
end
it "can leave a group message" do
channel =
Fabricate(
:direct_message_channel,
group: true,
users: [current_user, Fabricate(:user), Fabricate(:user)],
)
row = PageObjects::Components::Chat::ChannelRow.new(channel.id)
drawer_page.visit_index
drawer_page.click_direct_messages
expect(row).to exist
row.leave
expect(row).to be_non_existent
end
end