added s authState which helps conditonaly render components based on this state stored user details in localStoarge so that server side end point does not get hit in every page load. add a guard which protects routes and redirects to login if user is not logged in. create a logout route
17 lines
381 B
TypeScript
17 lines
381 B
TypeScript
import { TestBed } from "@angular/core/testing";
|
|
|
|
import { LocalStorageService } from "./local-storage.service";
|
|
|
|
describe("LocalStorage", () => {
|
|
let service: LocalStorageService;
|
|
|
|
beforeEach(() => {
|
|
TestBed.configureTestingModule({});
|
|
service = TestBed.inject(LocalStorageService);
|
|
});
|
|
|
|
it("should be created", () => {
|
|
expect(service).toBeTruthy();
|
|
});
|
|
});
|