Files
wgenerator/src/app/modules/songs/song-list/song-list.component.spec.ts
2025-01-02 15:01:59 +01:00

38 lines
1009 B
TypeScript

import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing';
import {SongListComponent} from './song-list.component';
import {of} from 'rxjs';
import {SongService} from '../services/song.service';
import {NO_ERRORS_SCHEMA} from '@angular/core';
describe('SongListComponent', () => {
let component: SongListComponent;
let fixture: ComponentFixture<SongListComponent>;
const songs = [{title: 'title1'}];
const mockSongService = {
list: () => of(songs),
};
beforeEach(
waitForAsync(() => {
void TestBed.configureTestingModule({
declarations: [SongListComponent],
providers: [{provide: SongService, useValue: mockSongService}],
schemas: [NO_ERRORS_SCHEMA],
}).compileComponents();
}),
);
beforeEach(() => {
fixture = TestBed.createComponent(SongListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
void expect(component).toBeTruthy();
});
});