fix tests
This commit is contained in:
@@ -1,24 +1,25 @@
|
||||
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 {ActivatedRoute} from '@angular/router';
|
||||
import {TextRenderingService} from '../services/text-rendering.service';
|
||||
import {UserService} from '../../../services/user/user.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),
|
||||
};
|
||||
const songs = [{id: 'song-1', title: 'title1', number: 1, text: '', flags: ''}];
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
void TestBed.configureTestingModule({
|
||||
imports: [SongListComponent],
|
||||
providers: [{provide: SongService, useValue: mockSongService}],
|
||||
providers: [
|
||||
{provide: ActivatedRoute, useValue: {data: of({songs})}},
|
||||
{provide: TextRenderingService, useValue: {validateChordNotation: () => []}},
|
||||
{provide: UserService, useValue: {user$: of({role: 'leader'}), loggedIn$: () => of(true)}},
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user