aboutsummaryrefslogtreecommitdiff
path: root/Timeline/ClientApp/src/app/user/user-logout/user-logout.component.spec.ts
diff options
context:
space:
mode:
Diffstat (limited to 'Timeline/ClientApp/src/app/user/user-logout/user-logout.component.spec.ts')
-rw-r--r--Timeline/ClientApp/src/app/user/user-logout/user-logout.component.spec.ts35
1 files changed, 35 insertions, 0 deletions
diff --git a/Timeline/ClientApp/src/app/user/user-logout/user-logout.component.spec.ts b/Timeline/ClientApp/src/app/user/user-logout/user-logout.component.spec.ts
new file mode 100644
index 00000000..855ea4a1
--- /dev/null
+++ b/Timeline/ClientApp/src/app/user/user-logout/user-logout.component.spec.ts
@@ -0,0 +1,35 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { UserLogoutComponent } from './user-logout.component';
+import { InternalUserService } from '../internal-user-service/internal-user.service';
+
+describe('UserLogoutComponent', () => {
+ let component: UserLogoutComponent;
+ let fixture: ComponentFixture<UserLogoutComponent>;
+
+ let mockInternalUserService: jasmine.SpyObj<InternalUserService>;
+
+ beforeEach(async(() => {
+ mockInternalUserService = jasmine.createSpyObj('InternalUserService', ['logout']);
+
+ TestBed.configureTestingModule({
+ declarations: [UserLogoutComponent],
+ providers: [{ provide: InternalUserService, useValue: mockInternalUserService }]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(UserLogoutComponent);
+ component = fixture.componentInstance;
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+
+ it('should logout on init', () => {
+ fixture.detectChanges();
+ expect(mockInternalUserService.logout).toHaveBeenCalled();
+ });
+});