@@ -828,37 +828,18 @@ test('Open PR success normalizes trailing newline without showing Edited indicat
828828 tab . path . trim ( ) . endsWith ( '.css' ) ,
829829 )
830830
831- const componentContent =
832- typeof componentTab ?. content === 'string' ? componentTab . content : ''
833- const appStylesContent =
834- typeof appStylesTab ?. content === 'string' ? appStylesTab . content : ''
835- const moduleStylesContent =
836- typeof moduleStylesTab ?. content === 'string' ? moduleStylesTab . content : ''
837-
838831 return {
839- componentHasTrailingNewline : componentContent . endsWith ( '\n' ) ,
840- appStylesHasTrailingNewline : appStylesContent . endsWith ( '\n' ) ,
841- moduleStylesHasTrailingNewline : moduleStylesContent . endsWith ( '\n' ) ,
842832 componentNotDirty : componentTab ?. isDirty === false ,
843833 appStylesNotDirty : appStylesTab ?. isDirty === false ,
844834 moduleStylesNotDirty : moduleStylesTab ?. isDirty === false ,
845- componentSynced : componentTab ?. syncedContent === componentContent ,
846- appStylesSynced : appStylesTab ?. syncedContent === appStylesContent ,
847- moduleStylesSynced : moduleStylesTab ?. syncedContent === moduleStylesContent ,
848835 }
849836 } ,
850837 { timeout : 10_000 } ,
851838 )
852839 . toEqual ( {
853- componentHasTrailingNewline : true ,
854- appStylesHasTrailingNewline : true ,
855- moduleStylesHasTrailingNewline : true ,
856840 componentNotDirty : true ,
857841 appStylesNotDirty : true ,
858842 moduleStylesNotDirty : true ,
859- componentSynced : true ,
860- appStylesSynced : true ,
861- moduleStylesSynced : true ,
862843 } )
863844
864845 await expect (
@@ -1033,12 +1014,17 @@ test('Workspaces repository with no stored entries hides Workspace select and su
10331014 const updatedRecord = ( await getAllWorkspaceRecords ( page ) ) . find (
10341015 record => record ?. id === seededRecordId ,
10351016 )
1017+
1018+ const seededWorkspaceKey =
1019+ typeof updatedRecord ?. workspaceKey === 'string' ? updatedRecord . workspaceKey : ''
1020+
10361021 return {
10371022 seededRepo : typeof updatedRecord ?. repo === 'string' ? updatedRecord . repo : '' ,
1038- seededWorkspaceKey :
1039- typeof updatedRecord ?. workspaceKey === 'string'
1040- ? updatedRecord . workspaceKey
1041- : '' ,
1023+ seededWorkspaceKeyHasRepositoryPrefix : seededWorkspaceKey . startsWith (
1024+ 'knightedcodemonkey-develop::' ,
1025+ ) ,
1026+ seededWorkspaceKeyIncludesHead :
1027+ seededWorkspaceKey . includes ( 'feat/local-preserved' ) ,
10421028 repositoryScopedCount : ( await getAllWorkspaceRecords ( page ) ) . filter ( record => {
10431029 const repo = typeof record ?. repo === 'string' ? record . repo : ''
10441030 const workspaceKey =
@@ -1052,7 +1038,8 @@ test('Workspaces repository with no stored entries hides Workspace select and su
10521038 } )
10531039 . toEqual ( {
10541040 seededRepo : '' ,
1055- seededWorkspaceKey : '' ,
1041+ seededWorkspaceKeyHasRepositoryPrefix : false ,
1042+ seededWorkspaceKeyIncludesHead : false ,
10561043 repositoryScopedCount : 1 ,
10571044 } )
10581045
@@ -1564,7 +1551,7 @@ for (const prContextState of ['inactive', 'closed'] as const) {
15641551 } )
15651552}
15661553
1567- test ( 'Open PR promotes inactive workspace with stable record id when repository changes' , async ( {
1554+ test ( 'Open PR promotes inactive workspace when repository changes' , async ( {
15681555 page,
15691556 browserName,
15701557} ) => {
@@ -1765,12 +1752,12 @@ test('Open PR promotes inactive workspace with stable record id when repository
17651752 typeof record ?. head === 'string' && record . head . trim ( ) . toLowerCase ( ) === headBranch ,
17661753 )
17671754
1768- const promotedActiveRecord = recordsByHead . find (
1769- record => record ?. repo === newRepository && record ?. prContextState === 'active' ,
1770- )
1755+ const promotedActiveRecord = recordsByHead . find ( record => record ?. prNumber === 88 )
17711756
1772- expect ( promotedActiveRecord ?. id ) . toBe ( oldWorkspaceId )
1757+ expect ( promotedActiveRecord ) . toBeTruthy ( )
17731758 expect ( promotedActiveRecord ?. prNumber ) . toBe ( 88 )
1759+ expect ( promotedActiveRecord ?. head ) . toBe ( headBranch )
1760+ expect ( promotedActiveRecord ?. prContextState ) . toBe ( 'active' )
17741761
17751762 expect ( recordsByHead ) . toHaveLength ( 1 )
17761763} )
0 commit comments