quiz-duplicate.component.spec.ts 1.7 KB
Newer Older
Christopher Mark Fullarton's avatar
Christopher Mark Fullarton committed
1
import { HttpClientTestingModule } from '@angular/common/http/testing';
Christopher Mark Fullarton's avatar
Christopher Mark Fullarton committed
2
import { PLATFORM_ID } from '@angular/core';
3
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
Christopher Mark Fullarton's avatar
Christopher Mark Fullarton committed
4
import { RouterTestingModule } from '@angular/router/testing';
Christopher Mark Fullarton's avatar
Christopher Mark Fullarton committed
5 6 7 8
import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt';
import { TranslateService } from '@ngx-translate/core';
import { RxStompService } from '@stomp/ng2-stompjs';
import { MarkdownService, MarkedOptions } from 'ngx-markdown';
9
import { TranslateServiceMock } from '../../../_mocks/_services/TranslateServiceMock';
Christopher Mark Fullarton's avatar
Christopher Mark Fullarton committed
10
import { jwtOptionsFactory } from '../../lib/jwt.factory';
11 12 13 14 15 16 17 18
import { QuizDuplicateComponent } from './quiz-duplicate.component';

describe('QuizDuplicateComponent', () => {
  let component: QuizDuplicateComponent;
  let fixture: ComponentFixture<QuizDuplicateComponent>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
Christopher Mark Fullarton's avatar
Christopher Mark Fullarton committed
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
      imports: [
        RouterTestingModule, HttpClientTestingModule, JwtModule.forRoot({
          jwtOptionsProvider: {
            provide: JWT_OPTIONS,
            useFactory: jwtOptionsFactory,
            deps: [PLATFORM_ID],
          },
        }),
      ],
      providers: [
        MarkdownService, {
          provide: MarkedOptions,
          useValue: {},
        }, RxStompService, {
          provide: TranslateService,
          useClass: TranslateServiceMock,
        },
      ],
37 38 39 40 41
      declarations: [QuizDuplicateComponent],
    })
    .compileComponents();
  }));

Christopher Mark Fullarton's avatar
Christopher Mark Fullarton committed
42
  beforeEach(async(() => {
43 44 45
    fixture = TestBed.createComponent(QuizDuplicateComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
Christopher Mark Fullarton's avatar
Christopher Mark Fullarton committed
46
  }));
47

Christopher Mark Fullarton's avatar
Christopher Mark Fullarton committed
48
  it('should create', () => {
49 50 51
    expect(component).toBeTruthy();
  });
});