test('isAuthenticated() returns false when the TokenManager does not return an access token', async () => { AuthJS.mockImplementation(() => { return mockAuthJsInstanceWithError }); const auth = new Auth({ issuer: 'https://foo/oauth2/default', client_id: 'foo', redirect_uri: 'foo' }); const authenticated = await auth.isAuthenticated(); expect(authenticated).toBeFalsy(); });
test('isAuthenticated() returns false when the TokenManager does not return an access token', async () => { AuthJS.mockImplementation(() => { return mockAuthJsInstanceWithError }) const localVue = createLocalVue() localVue.use(Auth, { issuer: 'https://foo', client_id: 'foo', redirect_uri: 'foo', scope: 'foo bar', response_type: 'token' }) const authenticated = await localVue.prototype.$auth.isAuthenticated() expect(authenticated).toBeFalsy() })
beforeEach(() => { AuthJS.mockImplementation(() => { return mockAuthJsInstance }) })