FIX: do not show infinite loading state on draft with new users (#20582)

This commit is contained in:
Joffrey JAFFEUX 2023-03-08 15:21:20 +01:00 committed by GitHub
parent c659540475
commit 7f486cbc9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 0 deletions

View File

@ -115,6 +115,7 @@ export default class ChatLivePane extends Component {
@action
loadMessages() {
if (!this.args.channel?.id) {
this.loadedOnce = true;
return;
}

View File

@ -0,0 +1,26 @@
# frozen_string_literal: true
RSpec.describe "Draft message", type: :system, js: true do
fab!(:current_user) { Fabricate(:admin) }
let(:chat_page) { PageObjects::Pages::Chat.new }
let(:channel_page) { PageObjects::Pages::ChatChannel.new }
let(:drawer) { PageObjects::Pages::ChatDrawer.new }
before do
chat_system_bootstrap
sign_in(current_user)
end
context "when current user never interacted with other user" do
fab!(:user) { Fabricate(:user) }
it "opens channel info page" do
visit("/chat/draft-channel")
expect(page).to have_selector(".results")
find(".results .user:nth-child(1)").click
expect(channel_page).to have_no_loading_skeleton
end
end
end