FIX: correctly save scroll position in channel (#25345)

Due to an incorrect test the previous service was incorrectly implementing the map, and was most importantly not deleting the state when reaching bottom.
This commit is contained in:
Joffrey JAFFEUX
2024-01-19 22:49:14 +01:00
committed by GitHub
parent ccb5fa1a5a
commit aee7197c43
3 changed files with 17 additions and 7 deletions

View File

@ -375,7 +375,13 @@ RSpec.describe "Chat channel", type: :system do
sidebar_page.open_channel(channel_2)
sidebar_page.open_channel(channel_1)
expect(channel_page.messages).to have_message(id: channel_1.chat_messages[2].id)
expect(channel_page.messages).to have_no_message(id: channel_1.chat_messages[49].id)
find(".chat-scroll-to-bottom__button.visible").click
sidebar_page.open_channel(channel_2)
sidebar_page.open_channel(channel_1)
expect(channel_page.messages).to have_message(id: channel_1.chat_messages[49].id)
end
end
end