@@ -72,6 +72,13 @@ import {
7272 verifyEnablePinnedChatsOption ,
7373 selectDisablePinnedChats ,
7474 selectEnablePinnedChats ,
75+ verifyUnpinActionAvailable ,
76+ selectUnpinAction ,
77+ searchChats ,
78+ verifyEmptySearchResults ,
79+ verifyNoResultsFoundMessage ,
80+ verifyChatUnpinned ,
81+ clearSearch ,
7582} from './utils/chatManagement' ;
7683import { login } from './utils/login' ;
7784import {
@@ -169,7 +176,7 @@ test.describe('Lightspeed tests', () => {
169176 browser,
170177 } , testInfo ) => {
171178 await test . step ( 'Verify initial state of sidebar' , async ( ) => {
172- await assertChatDialogInitialState ( sharedPage , translations ) ;
179+ await assertChatDialogInitialState ( sharedPage , translations , devMode ) ;
173180 } ) ;
174181
175182 await test . step ( 'Close the sidebar and verify elements are hidden' , async ( ) => {
@@ -398,12 +405,14 @@ test.describe('Lightspeed tests', () => {
398405 ) ;
399406 } ) ;
400407
401- test . describe ( 'Chat Management' , ( ) => {
408+ const chatManagementDescribeFn = devMode
409+ ? test . describe
410+ : test . describe . skip ;
411+ chatManagementDescribeFn ( 'Chat Management' , ( ) => {
402412 const testChatName = 'Test Rename' ;
403413
404414 test ( 'Verify chat actions menu' , async ( ) => {
405415 await sharedPage . reload ( ) ;
406- await sharedPage . waitForTimeout ( 3000 ) ;
407416 await openChatContextMenu ( sharedPage ) ;
408417 await verifyChatContextMenuOptions ( sharedPage , translations ) ;
409418 } ) ;
@@ -438,7 +447,7 @@ test.describe('Lightspeed tests', () => {
438447 await verifyChatDeleted ( sharedPage , testChatName ) ;
439448 } ) ;
440449
441- test ( 'Verify disable pinned chats' , async ( ) => {
450+ test ( 'Verify disable pinned chats section via settings ' , async ( ) => {
442451 await verifyPinnedSectionVisible ( sharedPage , translations ) ;
443452 await verifyEmptyPinnedChatsMessage ( sharedPage , translations ) ;
444453 await verifyChatbotSettingsVisible ( sharedPage , translations ) ;
@@ -449,7 +458,7 @@ test.describe('Lightspeed tests', () => {
449458 await verifyPinnedChatsNotEmpty ( sharedPage , translations ) ;
450459 } ) ;
451460
452- test ( 'Verify enable pinned chats' , async ( ) => {
461+ test ( 'Verify enable pinned chats section via settings ' , async ( ) => {
453462 await verifyPinnedSectionHidden ( sharedPage , translations ) ;
454463 await verifyPinnedChatsNotEmpty ( sharedPage , translations ) ;
455464 await openChatbotSettings ( sharedPage , translations ) ;
@@ -458,11 +467,29 @@ test.describe('Lightspeed tests', () => {
458467 await verifyPinnedSectionVisible ( sharedPage , translations ) ;
459468 await verifyEmptyPinnedChatsMessage ( sharedPage , translations ) ;
460469 } ) ;
461- /**
462- * TODO (after persistence is implemented):
463- * - Verify pinned chat is visible after page refresh
464- * - Add test to verify unpin actions
465- */
470+
471+ test . describe ( 'Search no-results scenarios' , ( ) => {
472+ test ( 'Verify search results when chats are not pinned' , async ( ) => {
473+ await searchChats ( sharedPage , 'dummy search' , translations ) ;
474+ await verifyEmptySearchResults ( sharedPage , translations ) ;
475+ } ) ;
476+
477+ test ( 'Verify search results when chats are pinned' , async ( ) => {
478+ await sharedPage . reload ( ) ;
479+ await openChatContextMenu ( sharedPage ) ;
480+ await selectPinAction ( sharedPage , translations ) ;
481+ await searchChats ( sharedPage , 'dummy search' , translations ) ;
482+ await verifyNoResultsFoundMessage ( sharedPage , translations ) ;
483+ } ) ;
484+ } ) ;
485+
486+ test ( 'Verify unpin chat action removes chat from pinned section' , async ( ) => {
487+ await clearSearch ( sharedPage ) ;
488+ await openChatContextMenu ( sharedPage ) ;
489+ await verifyUnpinActionAvailable ( sharedPage , translations ) ;
490+ await selectUnpinAction ( sharedPage , translations ) ;
491+ await verifyChatUnpinned ( sharedPage , translations ) ;
492+ } ) ;
466493 } ) ;
467494 } ) ;
468495} ) ;
0 commit comments