@@ -52,6 +52,7 @@ test.describe('Debug pane', { tag: '@desktop' }, () => {
5252 await page . keyboard . press ( 'ArrowDown' )
5353 }
5454 } )
55+ let lastSegmentText = await segment . innerText ( )
5556 // TODO: if you type all the code at once without delay (or paste it in)
5657 // the initial segment artifact ID is different. This appears to be niche bug
5758 // that is being sidestepped in this test until https://github.com/KittyCAD/modeling-app/issues/9609 is addressed.
@@ -60,20 +61,24 @@ test.describe('Debug pane', { tag: '@desktop' }, () => {
6061 // Wait for keyboard input debounce and updated artifact graph.
6162 await page . waitForTimeout ( 1000 )
6263 } )
63- // Extract the artifact IDs from the debug artifact graph.
64- const initialSegmentIds = await segment . innerText ( { timeout : 5_000 } )
64+ await expect ( segment ) . not . toHaveText ( lastSegmentText )
6565 // The artifact ID should include a UUID.
66- expect ( initialSegmentIds ) . toMatch (
66+ const uuidRegexp =
6767 / [ 0 - 9 a - f A - F ] { 8 } - [ 0 - 9 a - f A - F ] { 4 } - [ 0 - 9 a - f A - F ] { 4 } - [ 0 - 9 a - f A - F ] { 4 } - [ 0 - 9 a - f A - F ] { 12 } /
68- )
69- await test . step ( 'Enter a comment' , async ( ) => {
68+ await expect ( segment ) . toHaveText ( uuidRegexp )
69+ const uuid = ( await segment . innerText ( ) ) . match ( uuidRegexp ) !
70+ console . log ( 'WHAT' , await segment . innerText ( ) )
71+
72+ await test . step ( 'Enter another line' , async ( ) => {
73+ lastSegmentText = await segment . innerText ( )
7074 await page . keyboard . type ( '\n|> line(end = [2, 2])' , { delay : 10 } )
7175 // Wait for keyboard input debounce and updated artifact graph.
7276 await page . waitForTimeout ( 1000 )
7377 } )
74- const newSegmentIds = await segment . innerText ( )
75- // Strip off the closing bracket.
76- const initialIds = initialSegmentIds . slice ( 0 , initialSegmentIds . length - 1 )
77- expect ( newSegmentIds . slice ( 0 , initialIds . length ) ) . toEqual ( initialIds )
78+
79+ // Expect the artifact IDs to be changed (by adding another),
80+ expect ( segment ) . not . toHaveText ( lastSegmentText )
81+ // but still contain the stable first ID.
82+ expect ( segment ) . toContainText ( uuid )
7883 } )
7984} )
0 commit comments