@@ -74,6 +74,7 @@ describe("atlas-local-create-deployment", () => {
7474 arguments : { } ,
7575 } ) ;
7676 const beforeElements = getResponseElements ( beforeResponse . content ) ;
77+ expect ( beforeElements . length ) . toBeGreaterThanOrEqual ( 1 ) ;
7778 expect ( beforeElements [ 1 ] ?. text ?? "" ) . not . toContain ( deploymentName ) ;
7879
7980 // Create a deployment
@@ -91,7 +92,7 @@ describe("atlas-local-create-deployment", () => {
9192
9293 const afterElements = getResponseElements ( afterResponse . content ) ;
9394 expect ( afterElements . length ) . toBeGreaterThanOrEqual ( 1 ) ;
94- expect ( afterElements [ 1 ] ?. text ) . toContain ( deploymentName ) ;
95+ expect ( afterElements [ 1 ] ?. text ?? "" ) . toContain ( deploymentName ) ;
9596 } ) ;
9697
9798 it . skipIf ( isMacOSInGitHubActions ) (
@@ -137,8 +138,8 @@ describe("atlas-local-create-deployment", () => {
137138 const elements = getResponseElements ( response . content ) ;
138139
139140 expect ( elements . length ) . toBeGreaterThanOrEqual ( 1 ) ;
140- expect ( elements [ 1 ] ?. text ) . toContain ( deploymentName ) ;
141- expect ( elements [ 1 ] ?. text ) . toContain ( "Running" ) ;
141+ expect ( elements [ 1 ] ?. text ?? "" ) . toContain ( deploymentName ) ;
142+ expect ( elements [ 1 ] ?. text ?? "" ) . toContain ( "Running" ) ;
142143 } ) ;
143144
144145 it . skipIf ( isMacOSInGitHubActions ) ( "should create a deployment when name is not provided" , async ( { signal } ) => {
@@ -164,6 +165,6 @@ describe("atlas-local-create-deployment", () => {
164165 const deploymentName = elements [ 1 ] ?. text . match ( / l o c a l \d + / ) ?. [ 0 ] ;
165166 expectDefined ( deploymentName ) ;
166167 deploymentNamesToCleanup . push ( deploymentName ) ;
167- expect ( elements [ 1 ] ?. text ) . toContain ( "Running" ) ;
168+ expect ( elements [ 1 ] ?. text ?? "" ) . toContain ( "Running" ) ;
168169 } ) ;
169170} ) ;
0 commit comments