@@ -191,14 +191,19 @@ test('Open PR drawer confirms and submits default workspace filepaths', async ({
191191 expect ( createdRefPayload ?. ref ) . toBe ( 'refs/heads/Develop/Open-Pr-Test' )
192192 expect ( createdRefPayload ?. sha ) . toBe ( 'abc123mainsha' )
193193 expect ( treeRequests ) . toHaveLength ( 1 )
194- const submittedPaths = ( treeRequests [ 0 ] ?. tree as Array < Record < string , unknown > > ) . map (
194+ const submittedTree = treeRequests [ 0 ] ?. tree
195+ expect ( Array . isArray ( submittedTree ) ) . toBe ( true )
196+ const submittedPaths = ( submittedTree as Array < Record < string , unknown > > ) . map (
195197 entry => entry . path ,
196198 )
197- expect ( submittedPaths ) . toEqual ( [
198- 'src/components/App.tsx' ,
199- 'src/components/Counter.tsx' ,
200- 'src/styles/app.css' ,
201- ] )
199+ expect ( submittedPaths ) . toHaveLength ( 3 )
200+ expect ( submittedPaths ) . toEqual (
201+ expect . arrayContaining ( [
202+ 'src/components/App.tsx' ,
203+ 'src/components/Counter.tsx' ,
204+ 'src/styles/app.css' ,
205+ ] ) ,
206+ )
202207 expect ( commitRequests ) . toHaveLength ( 1 )
203208 expect ( commitRequests [ 0 ] ?. message ) . toBe ( customCommitMessage )
204209 expect ( updateRefRequests ) . toHaveLength ( 1 )
@@ -2090,14 +2095,19 @@ test('Open PR drawer uses Git Database API atomic commit path by default', async
20902095 )
20912096
20922097 expect ( treeRequests ) . toHaveLength ( 1 )
2093- const submittedPaths = ( treeRequests [ 0 ] ?. tree as Array < Record < string , unknown > > ) . map (
2098+ const submittedTree = treeRequests [ 0 ] ?. tree
2099+ expect ( Array . isArray ( submittedTree ) ) . toBe ( true )
2100+ const submittedPaths = ( submittedTree as Array < Record < string , unknown > > ) . map (
20942101 entry => entry . path ,
20952102 )
2096- expect ( submittedPaths ) . toEqual ( [
2097- 'src/components/App.tsx' ,
2098- 'src/components/Counter.tsx' ,
2099- 'src/styles/app.css' ,
2100- ] )
2103+ expect ( submittedPaths ) . toHaveLength ( 3 )
2104+ expect ( submittedPaths ) . toEqual (
2105+ expect . arrayContaining ( [
2106+ 'src/components/App.tsx' ,
2107+ 'src/components/Counter.tsx' ,
2108+ 'src/styles/app.css' ,
2109+ ] ) ,
2110+ )
21012111 expect ( commitRequests ) . toHaveLength ( 1 )
21022112 expect ( updateRefRequests ) . toHaveLength ( 1 )
21032113 expect ( updateRefRequests [ 0 ] ?. sha ) . toBe ( 'new-commit-sha' )
0 commit comments