Skip to content
Snippets Groups Projects
Forked from an inaccessible project.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
term-container.component.spec.ts 1.79 KiB
import { Observable, of } from 'rxjs';
import { Note } from './../../core/models/note';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';

import { SharedModule } from '@app/shared/shared.module';
import { CoreModule } from '@app/core/core.module';
import { DataService } from '@app/core/data.service';
import { HttpClient, HttpClientModule } from '@angular/common/http';

import { TermContainerComponent } from './term-container.component';
import { Term } from '@app/core/models/term';
import { SidenavService } from '@app/core/service/sidenav.service';

describe('TermContainerComponent', () => {
	let termComponent: TermContainerComponent;
	let fixture: ComponentFixture<TermContainerComponent>;

	beforeEach(async(() => {
		TestBed.configureTestingModule({
			imports: [RouterTestingModule, HttpClientModule, CoreModule, SharedModule],
			declarations: [TermContainerComponent],
			providers: [DataService, SidenavService],
			schemas: [NO_ERRORS_SCHEMA]
		})
		.compileComponents();
	}));

	beforeEach(() => {
		fixture = TestBed.createComponent(TermContainerComponent);
		termComponent = fixture.componentInstance;
		const term: Term = {
			academicYear: '2018-19',
			beginDate: 1545631200000,
			endDate: 1557723599999,
			instructionBeginDate: 1548136800000,
			instructionEndDate: 1556945999999,
			longDescription: 'Spring 2018-2019',
			pastTerm: false,
			shortDescription: '2019 Sprng',
			termCode: '1194'
		};
		termComponent.term = term;
		const notes: Note[] = [{
			id: 323,
			termCode: '1174',
			note: 'teset'
		}];

		termComponent.notes = of(<Note[]> notes);
		fixture.detectChanges();
	});

	it('should create', () => {
		expect(termComponent).toBeTruthy();
	});
});