Skip to content

Commit

Permalink
no static property in session service, add spec
Browse files Browse the repository at this point in the history
  • Loading branch information
lukavdplas committed May 13, 2024
1 parent b52c8d9 commit 2da4a19
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
16 changes: 16 additions & 0 deletions frontend/src/app/services/session.service.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { SessionService } from './session.service';

describe('SessionService', () => {
let service: SessionService;

beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(SessionService);
});

it('should be created', () => {
expect(service).toBeTruthy();
});

});
8 changes: 4 additions & 4 deletions frontend/src/app/services/session.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { Subject } from 'rxjs';
providedIn: 'root'
})
export class SessionService {
private static sessionExpiredSubject = new Subject<void>();
public expired = SessionService.sessionExpiredSubject.asObservable();
private sessionExpiredSubject = new Subject<void>();
public expired = this.sessionExpiredSubject.asObservable();

public static markExpired() {
SessionService.sessionExpiredSubject.next();
public markExpired() {
this.sessionExpiredSubject.next();
}
}

0 comments on commit 2da4a19

Please sign in to comment.