Created
November 14, 2018 12:36
-
-
Save LironHazan/c6adf18b7d7c71b4d8e1e5c9b0ef7f6d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |
import { LoginComponent } from './login.component'; | |
import {AppTestingModule} from "../app-testing.module"; | |
import {NO_ERRORS_SCHEMA} from "@angular/core"; | |
import {LocalStorageWrapperService} from "../services/local-storage-wrapper.service"; | |
describe('LoginComponent', () => { | |
let component: LoginComponent; | |
let fixture: ComponentFixture<LoginComponent>; | |
let localStorage = new LocalStorageWrapperService(); | |
beforeEach(async(() => { | |
TestBed.configureTestingModule({ | |
imports: [AppTestingModule], | |
declarations: [ LoginComponent ], | |
schemas: [ NO_ERRORS_SCHEMA ] | |
}) | |
.compileComponents(); | |
})); | |
beforeEach(() => { | |
localStorage.set('currentUser', 'foo'); | |
fixture = TestBed.createComponent(LoginComponent); | |
component = fixture.componentInstance; | |
fixture.detectChanges(); | |
}); | |
it('should create', () => { | |
expect(component).toBeTruthy(); | |
}); | |
it('should not be loggedin', () => { | |
expect(component.isLogged()).toBeFalsy(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment