mirror of
https://github.com/discourse/discourse.git
synced 2024-12-18 12:53:46 +08:00
b5e736504a
- group writes when computing separators positions - shows skeleton only on initial load - forces date separator to be pinned when first message to prevent a pinned - not pinned - pinned sequence when loading more in past - relies on `message.visible` property instead of checking `isElementInViewport` - attempts to load next/prev messages earlier - do not scroll to on fetch more - hides `last visit` text while pinned
28 lines
851 B
Ruby
28 lines
851 B
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec.describe "Deleted message", type: :system, js: true do
|
|
let(:chat_page) { PageObjects::Pages::Chat.new }
|
|
let(:channel_page) { PageObjects::Pages::ChatChannel.new }
|
|
|
|
fab!(:current_user) { Fabricate(:user) }
|
|
fab!(:channel_1) { Fabricate(:category_channel) }
|
|
|
|
before do
|
|
chat_system_bootstrap
|
|
channel_1.add(current_user)
|
|
sign_in(current_user)
|
|
end
|
|
|
|
context "when deleting a message" do
|
|
it "shows as deleted" do
|
|
chat_page.visit_channel(channel_1)
|
|
channel_page.send_message("aaaaaaaaaaaaaaaaaaaa")
|
|
expect(page).to have_no_css(".chat-message-staged")
|
|
last_message = find(".chat-message-container:last-child")
|
|
channel_page.delete_message(OpenStruct.new(id: last_message["data-id"]))
|
|
|
|
expect(page).to have_content(I18n.t("js.chat.deleted"))
|
|
end
|
|
end
|
|
end
|