Commit 35bcfd62 authored by Eduardo Sanz García's avatar Eduardo Sanz García
Browse files

refactor: general cleanup (see below)

* Use jasmine-core 2.99.0 onward but not 3.0 (problem with that version)
* Remove _blank attributes
* Replaces undefined by null
parent 0628b970
Pipeline #2741 passed with stages
in 3 minutes and 27 seconds
......@@ -15,7 +15,7 @@ session storage).
To install this library, run:
```
npm install angular-aap-auth --save
npm install --save angular-aap-auth
or
......@@ -78,8 +78,8 @@ import {
selector: 'app-root',
template: `
<button (click)="auth.windowOpen()">Login small window</button>
<button (click)="auth.tabOpen()" target="_blank">Login new tab</button>
<button (click)="auth.logOut()" target="_blank">Logout</button>
<button (click)="auth.tabOpen()">Login new tab</button>
<button (click)="auth.logOut()">Logout</button>
<div *ngIf="(credentials | async) as user; else loggedOut">
<p>Real name: {{ user.realname }}</p>
......@@ -130,8 +130,8 @@ import {
selector: 'app-root',
template: `
<button (click)="auth.windowOpen()">Login small window</button>
<button (click)="auth.tabOpen()" target="_blank">Login new tab</button>
<button (click)="auth.logOut()" target="_blank">Logout</button>
<button (click)="auth.tabOpen()">Login new tab</button>
<button (click)="auth.logOut()">Logout</button>
<p>Authenticated: {{ isAuthenticated|async }}</p>
<p>Real name: {{ realname|async }}</p>
......@@ -237,7 +237,7 @@ import {
selector: 'app-root',
template: `
<button (click)="openLoginWindow()">Login small window</button>
<button (click)="logOut()" target="_blank">Logout</button>
<button (click)="logOut()">Logout</button>
<p>Real name: {{ realname|async }}</p>
<p>Username: {{ username|async }}</p>
......
......@@ -6,8 +6,8 @@
</div>
<div class="spread">
<button (click)="auth.windowOpen({ttl: '1'})">Login small window</button>
<button (click)="auth.tabOpen({ttl: '1'})" target="_blank">Login new tab</button>
<button (click)="auth.logOut()" target="_blank">Logout</button>
<button (click)="auth.tabOpen({ttl: '1'})">Login new tab</button>
<button (click)="auth.logOut()">Logout</button>
</div>
<div *ngIf="(credentials | async) as user; else loggedOut">
<p>Real name: {{ user.realname }}</p>
......
......@@ -40,7 +40,7 @@ export class AuthService {
private _loginCallbacks: Function[] = [];
private _logoutCallbacks: Function[] = [];
private _timeoutID: number | undefined = undefined;
private _timeoutID: number | null = null;
// Configuration
private readonly _domain: string;
......
......@@ -58,8 +58,8 @@ describe('TokenService (valid token)', () => {
expect(service.getClaim('issr', null)).toEqual(null);
}));
it('getClaim should with non-existing claim should return default value undefined', inject([TokenService], (service: TokenService) => {
expect(service.getClaim('issr', undefined)).toEqual(undefined);
it('getClaim should with non-existing claim should return default value null', inject([TokenService], (service: TokenService) => {
expect(service.getClaim('issr', null)).toEqual(null);
}));
});
......@@ -106,7 +106,7 @@ describe('TokenService (expired token)', () => {
expect(service.getClaim('issr', null)).toEqual(null);
}));
it('getClaim should with non-existing claim should return default value undefined', inject([TokenService], (service: TokenService) => {
expect(service.getClaim('issr', undefined)).toEqual(undefined);
it('getClaim should with non-existing claim should return default value null', inject([TokenService], (service: TokenService) => {
expect(service.getClaim('issr', null)).toEqual(null);
}));
});
......@@ -3675,14 +3675,14 @@ istanbul-reports@^1.1.4:
dependencies:
handlebars "^4.0.3"
jasmine-core@^2.99.1:
version "2.99.1"
resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.99.1.tgz#e6400df1e6b56e130b61c4bcd093daa7f6e8ca15"
jasmine-core@~2.8.0:
version "2.8.0"
resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e"
jasmine-core@~2.99.1:
version "2.99.1"
resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.99.1.tgz#e6400df1e6b56e130b61c4bcd093daa7f6e8ca15"
jasmine-spec-reporter@~4.2.1:
version "4.2.1"
resolved "https://registry.yarnpkg.com/jasmine-spec-reporter/-/jasmine-spec-reporter-4.2.1.tgz#1d632aec0341670ad324f92ba84b4b32b35e9e22"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment