vitest implementation
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing';
|
||||
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
||||
|
||||
import {LegalComponent} from './legal.component';
|
||||
|
||||
@@ -6,11 +6,11 @@ describe('LegalComponent', () => {
|
||||
let component: LegalComponent;
|
||||
let fixture: ComponentFixture<LegalComponent>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
void TestBed.configureTestingModule({
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [LegalComponent],
|
||||
}).compileComponents();
|
||||
}));
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(LegalComponent);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing';
|
||||
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
||||
|
||||
import {LogoComponent} from './logo.component';
|
||||
|
||||
@@ -6,11 +6,11 @@ describe('LogoComponent', () => {
|
||||
let component: LogoComponent;
|
||||
let fixture: ComponentFixture<LogoComponent>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
void TestBed.configureTestingModule({
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [LogoComponent],
|
||||
}).compileComponents();
|
||||
}));
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(LogoComponent);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing';
|
||||
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
||||
|
||||
import {MonitorComponent} from './monitor.component';
|
||||
|
||||
@@ -6,11 +6,11 @@ describe('MonitorComponent', () => {
|
||||
let component: MonitorComponent;
|
||||
let fixture: ComponentFixture<MonitorComponent>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
void TestBed.configureTestingModule({
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [MonitorComponent],
|
||||
}).compileComponents();
|
||||
}));
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(MonitorComponent);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing';
|
||||
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
||||
|
||||
import {RemoteComponent} from './remote.component';
|
||||
|
||||
@@ -6,11 +6,11 @@ describe('RemoteComponent', () => {
|
||||
let component: RemoteComponent;
|
||||
let fixture: ComponentFixture<RemoteComponent>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
void TestBed.configureTestingModule({
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [RemoteComponent],
|
||||
}).compileComponents();
|
||||
}));
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(RemoteComponent);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
||||
import {Router} from '@angular/router';
|
||||
import {of} from 'rxjs';
|
||||
import {firstValueFrom, of} from 'rxjs';
|
||||
import {GlobalSettingsService} from '../../../services/global-settings.service';
|
||||
import {ShowService} from '../../shows/services/show.service';
|
||||
import {SelectComponent} from './select.component';
|
||||
@@ -52,12 +52,11 @@ describe('SelectComponent', () => {
|
||||
expect(component.visible).toBeTrue();
|
||||
});
|
||||
|
||||
it('should expose recent shows sorted descending by date', done => {
|
||||
component.shows$.subscribe(shows => {
|
||||
expect(showServiceSpy.list$).toHaveBeenCalledWith(true);
|
||||
expect(shows.map(show => show.id)).toEqual(['recent-a', 'recent-b']);
|
||||
done();
|
||||
});
|
||||
it('should expose recent shows sorted descending by date', async () => {
|
||||
const shows = await firstValueFrom(component.shows$);
|
||||
|
||||
expect(showServiceSpy.list$).toHaveBeenCalledWith(true);
|
||||
expect(shows.map(show => show.id)).toEqual(['recent-a', 'recent-b']);
|
||||
});
|
||||
|
||||
it('should persist the selected show, trigger presentation reset and navigate', async () => {
|
||||
|
||||
@@ -5,8 +5,8 @@ import {PresentationService} from './presentation.service';
|
||||
describe('PresentationService', () => {
|
||||
let service: PresentationService;
|
||||
|
||||
beforeEach(() => {
|
||||
void TestBed.configureTestingModule({});
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(PresentationService);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user