reading-confirmation-progress.component.spec.ts 1.97 KB
Newer Older
1 2
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
Christopher Mark Fullarton's avatar
Christopher Mark Fullarton committed
3
import { TranslateService } from '@ngx-translate/core';
Christopher Mark Fullarton's avatar
Christopher Mark Fullarton committed
4
import { MarkdownService, MarkedOptions } from 'ngx-markdown';
5
import { TranslateServiceMock } from '../../../../../_mocks/_services/TranslateServiceMock';
6
import { I18nService } from '../../../../service/i18n/i18n.service';
7 8
import { StorageService } from '../../../../service/storage/storage.service';
import { StorageServiceMock } from '../../../../service/storage/storage.service.mock';
9
import { SharedModule } from '../../../../shared/shared.module';
Christopher Mark Fullarton's avatar
Christopher Mark Fullarton committed
10

11
import { ReadingConfirmationProgressComponent } from './reading-confirmation-progress.component';
Christopher Mark Fullarton's avatar
Christopher Mark Fullarton committed
12

13
describe('Quiz-Results: ReadingConfirmationComponent', () => {
14 15
  let component: ReadingConfirmationProgressComponent;
  let fixture: ComponentFixture<ReadingConfirmationProgressComponent>;
Christopher Mark Fullarton's avatar
Christopher Mark Fullarton committed
16 17 18

  beforeEach(async(() => {
    TestBed.configureTestingModule({
19
      imports: [
Christopher Mark Fullarton's avatar
Christopher Mark Fullarton committed
20
        SharedModule, RouterTestingModule,
21 22
      ],
      providers: [
Christopher Mark Fullarton's avatar
Christopher Mark Fullarton committed
23 24 25 26
        MarkdownService, {
          provide: MarkedOptions,
          useValue: {},
        },
27
        {
28 29
          provide: StorageService,
          useClass: StorageServiceMock,
Christopher Mark Fullarton's avatar
Christopher Mark Fullarton committed
30 31 32 33
        }, I18nService, {
          provide: TranslateService,
          useClass: TranslateServiceMock,
        },
34
      ],
35
      declarations: [ReadingConfirmationProgressComponent],
36
    }).compileComponents();
Christopher Mark Fullarton's avatar
Christopher Mark Fullarton committed
37 38
  }));

39
  beforeEach(async(() => {
40
    fixture = TestBed.createComponent(ReadingConfirmationProgressComponent);
Christopher Mark Fullarton's avatar
Christopher Mark Fullarton committed
41 42
    component = fixture.componentInstance;
    fixture.detectChanges();
43
  }));
Christopher Mark Fullarton's avatar
Christopher Mark Fullarton committed
44

45
  it('should be created', async(() => {
Christopher Mark Fullarton's avatar
Christopher Mark Fullarton committed
46
    expect(component).toBeTruthy();
47
  }));
48
  it('should contain a TYPE reference', () => {
Christopher Mark Fullarton's avatar
Christopher Mark Fullarton committed
49
    expect(ReadingConfirmationProgressComponent.TYPE).toEqual('ReadingConfirmationProgressComponent');
50 51 52 53 54
  });

  it('#sanitizeStyle', () => {
    expect(component.sanitizeStyle('20%')).toBeTruthy();
  });
Christopher Mark Fullarton's avatar
Christopher Mark Fullarton committed
55
});