@@ -90,51 +90,4 @@ describe('StagingJobHandler Tests', () => {
9090 expect ( queueManifestJobSpy ) . toBeCalledTimes ( 0 ) ;
9191 expect ( jobHandlerTestHelper . jobRepo . insertJob ) . toBeCalledTimes ( 0 ) ;
9292 } ) ;
93-
94- describe ( 'Gatsby Cloud build hooks' , ( ) => {
95- beforeEach ( ( ) => {
96- process . env . GATSBY_CLOUD_PREVIEW_WEBHOOK_ENABLED = 'true' ;
97- } ) ;
98-
99- test ( 'Staging with Gatsby Cloud site does not result in immediate job completion' , async ( ) => {
100- jobHandlerTestHelper . setStageForDeploySuccess ( false , undefined , { hasGatsbySiteId : true } ) ;
101- await jobHandlerTestHelper . jobHandler . execute ( ) ;
102- // Post-build webhook is expected to update the status
103- expect ( jobHandlerTestHelper . jobRepo . updateWithStatus ) . toBeCalledTimes ( 0 ) ;
104- } ) ;
105-
106- test ( 'Gatsby Cloud build hook fail results in job failure' , async ( ) => {
107- jobHandlerTestHelper . setStageForDeploySuccess ( false , undefined , { hasGatsbySiteId : true } ) ;
108- spyPost . mockImplementationOnce ( ( ) => Promise . reject ( { } ) ) ;
109- await jobHandlerTestHelper . jobHandler . execute ( ) ;
110- expect ( jobHandlerTestHelper . jobRepo . updateWithErrorStatus ) . toBeCalledTimes ( 1 ) ;
111- } ) ;
112- } ) ;
113-
114- describe ( 'Netlify build hooks' , ( ) => {
115- beforeEach ( ( ) => {
116- process . env . GATSBY_CLOUD_PREVIEW_WEBHOOK_ENABLED = 'true' ;
117- } ) ;
118-
119- test ( 'Staging with Netlify does not result in immediate job completion with Gatsby Cloud' , async ( ) => {
120- jobHandlerTestHelper . setStageForDeploySuccess ( false , undefined , {
121- hasGatsbySiteId : true ,
122- hasNetlifyBuildHook : true ,
123- } ) ;
124- await jobHandlerTestHelper . jobHandler . execute ( ) ;
125- // Post-build webhook is expected to update the status
126- expect ( jobHandlerTestHelper . jobRepo . updateWithStatus ) . toBeCalledTimes ( 0 ) ;
127- } ) ;
128-
129- test ( 'Netlify build hook error does not interfere with job execution' , async ( ) => {
130- jobHandlerTestHelper . setStageForDeploySuccess ( false , undefined , { hasNetlifyBuildHook : true } ) ;
131- spyPost . mockImplementationOnce ( ( ) => Promise . reject ( { } ) ) ;
132- await jobHandlerTestHelper . jobHandler . execute ( ) ;
133- expect ( jobHandlerTestHelper . jobRepo . updateWithStatus ) . toBeCalledWith (
134- expect . anything ( ) ,
135- undefined ,
136- JobStatus . completed
137- ) ;
138- } ) ;
139- } ) ;
14093} ) ;
0 commit comments