Пример #1
0
 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();
 });
Пример #2
0
 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()
 })
Пример #3
0
 beforeEach(() => {
   AuthJS.mockImplementation(() => {
     return mockAuthJsInstance
   })
 })