diff --git a/goofy-client/apps/goofy-e2e/src/integration/interceptor/interceptor-unauthorized.e2e-spec.ts b/goofy-client/apps/goofy-e2e/src/integration/interceptor/interceptor-unauthorized.e2e-spec.ts index 9961363dc5bd1389ee183ed172a3179d8f397b55..a6efe141733895753b0695a2f13483e2b00171d1 100644 --- a/goofy-client/apps/goofy-e2e/src/integration/interceptor/interceptor-unauthorized.e2e-spec.ts +++ b/goofy-client/apps/goofy-e2e/src/integration/interceptor/interceptor-unauthorized.e2e-spec.ts @@ -31,16 +31,11 @@ describe('Interceptor unauthorized', () => { const BASE_PATH: string = '*/vorgangs/'; const statusCode: number = 401; - const interceptorResponseUnauthorized: string = 'getVorgangWithEingang'; - const interceptorResponseOk: string = 'getVorgangWithEingang'; - - beforeEach(() => { - const url: string = BASE_PATH + vorgang._id.$oid; - - interceptWithResponse('GET', url, { statusCode }).as(interceptorResponseUnauthorized); - }) + const interceptorResponseUnauthorized: string = 'getVorgangWithEingangUnauthorized'; it('should reload page', () => { + interceptWithResponse('GET', BASE_PATH + vorgang._id.$oid, { statusCode }).as(interceptorResponseUnauthorized); + vorgangList.getListItem(vorgang.name).getRoot().click({ force: true }); waitOfInterceptor(interceptorResponseUnauthorized).then((interception) => { @@ -48,15 +43,18 @@ describe('Interceptor unauthorized', () => { exist(vorgangPage.getSpinner()); vorgangPage.waitForSpinnerToDisappear(); + }) + }) - interceptWithResponse('GET', BASE_PATH + vorgang._id.$oid, { statusCode: 200, body: vorgang }).as(interceptorResponseOk); + it('should show vorgang detail on successfully reload ', () => { + exist(vorgangPage.getSpinner()); - waitOfInterceptor(interceptorResponseOk).then((interception) => { - assert(interception.response.statusCode, '200'); - exist(vorgangHeader.getRoot()); - contains(vorgangHeader.getName(), vorgang.name); - }) - }) + interceptWithResponse('GET', BASE_PATH + vorgang._id.$oid, { statusCode: 200, body: vorgang }); + + vorgangPage.waitForSpinnerToDisappear(); + + exist(vorgangHeader.getRoot()); + contains(vorgangHeader.getName(), vorgang.name); }) it('should navigate back on back button', () => {