@@ -71,25 +71,6 @@ test.describe('thread autoscroll', () => {
7171 await message . scrollIntoViewIfNeeded ( ) ;
7272 await expectToOpenThreadAndSeeLatestMessage ( page , user , MESSAGES_WITH_REPLIES [ 1 ] ) ;
7373 } ) ;
74-
75- test ( 'if I scroll primary message list by clicking a quoted message already loaded in state' , async ( {
76- page,
77- user,
78- } ) => {
79- await user . clicks ( QuotedMessage ) . nth ( QUOTED_MESSAGES [ 0 ] ) ;
80- await expectToOpenThreadAndSeeLatestMessage ( page , user , QUOTED_MESSAGES [ 0 ] ) ;
81- } ) ;
82-
83- test ( 'if I scroll primary message list by clicking a quoted message that has to be loaded in state' , async ( {
84- page,
85- user,
86- } ) => {
87- await user . clicks ( QuotedMessage ) . nth ( QUOTED_MESSAGES [ 1 ] , 2 ) ;
88- await Promise . all ( [
89- page . waitForResponse ( ( r ) => r . url ( ) . includes ( '/messages' ) && r . ok ( ) ) ,
90- expectToOpenThreadAndSeeLatestMessage ( page , user , QUOTED_MESSAGES [ 1 ] ) ,
91- ] ) ;
92- } ) ;
9374 } ) ;
9475
9576 test . describe ( 'on new message' , ( ) => {
@@ -185,71 +166,4 @@ test.describe('scroll to the bottom', () => {
185166 . sees ( MessageList )
186167 . isScrolledToBottom ( `${ USER1_CHAT_VIEW_CLASSNAME } ${ selectors . messageListContainer } ` ) ;
187168 } ) ;
188-
189- test ( 'after loading more messages on new message notification click' , async ( {
190- controller,
191- page,
192- user,
193- } ) => {
194- // scroll without loading more messages
195- await scrollInSteps ( user ) ;
196-
197- // trigger load more messages
198- const firstLoadedMessage = await page . locator (
199- `${ USER1_CHAT_VIEW_CLASSNAME } ${ selectors . messageListContainer } li:first-of-type` ,
200- ) ;
201- await firstLoadedMessage . scrollIntoViewIfNeeded ( ) ;
202- await controller . sendOtherUserMessage ( ) ;
203-
204- // click the notification
205- await page . waitForSelector ( getMessageNotificationSelector ( NEW_MESSAGE_NOTIFICATION_TEXT ) ) ;
206- await user . clicks ( MessageNotification ) . text ( NEW_MESSAGE_NOTIFICATION_TEXT ) ;
207-
208- // check that you are at the bottom
209- await user
210- . sees ( MessageList )
211- . isScrolledToBottom ( `${ USER1_CHAT_VIEW_CLASSNAME } ${ selectors . messageListContainer } ` ) ;
212- } ) ;
213- } ) ;
214-
215- test . describe ( 'pagination' , ( ) => {
216- test . beforeEach ( async ( { controller, user } ) => {
217- await controller . openStory (
218- 'navigate-long-message-lists--user1' ,
219- selectors . channelPreviewButton ,
220- ) ;
221- await user . clicks ( ChannelPreview ) . text ( CHANNEL_NAME ) ;
222- } ) ;
223-
224- test ( 'does not lead to the viewport content change' , async ( { page, user } ) => {
225- const messageList = await page . locator ( `${ USER1_CHAT_VIEW_CLASSNAME } ${ selectors . messageList } ` ) ;
226-
227- const firstMessageFirstPage = await user . get ( Message ) ( FIRST_MESSAGE_FIRST_PAGE ) ;
228-
229- let firstLoadedMessageBoxBeforePagination ;
230- const msgListBoxBeforePagination = await messageList . boundingBox ( ) ;
231-
232- // get message position before the next page of messages is received
233- page . once ( 'request' , async ( ) => {
234- firstLoadedMessageBoxBeforePagination = await firstMessageFirstPage . boundingBox ( ) ;
235- } ) ;
236-
237- await Promise . all ( [
238- page . waitForResponse ( ( r ) => r . url ( ) . includes ( '/query' ) && r . ok ( ) ) ,
239- firstMessageFirstPage . scrollIntoViewIfNeeded ( ) ,
240- ] ) ;
241-
242- const msgListBoxAfterPagination = await messageList . boundingBox ( ) ;
243- const firstLoadedMessageBoxAfterPagination = await firstMessageFirstPage . boundingBox ( ) ;
244-
245- const firstMessageShiftDistanceYToViewport =
246- firstLoadedMessageBoxBeforePagination . y - firstLoadedMessageBoxAfterPagination . y ;
247- expect ( firstMessageShiftDistanceYToViewport ) . toBeLessThanOrEqual (
248- firstLoadedMessageBoxBeforePagination . height ,
249- ) ;
250- expect ( firstMessageShiftDistanceYToViewport ) . toBeGreaterThanOrEqual (
251- - firstLoadedMessageBoxBeforePagination . height ,
252- ) ;
253- expect ( msgListBoxBeforePagination . height ) . not . toStrictEqual ( msgListBoxAfterPagination . height ) ;
254- } ) ;
255169} ) ;
0 commit comments