-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpublic-library.component.spec.ts
More file actions
40 lines (36 loc) · 1.37 KB
/
public-library.component.spec.ts
File metadata and controls
40 lines (36 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { PublicLibraryComponent } from './public-library.component';
import { MockProvider } from 'ng-mocks';
import { LibraryService } from '../../../services/library.service';
import { of } from 'rxjs';
import { ProjectFilterValues } from '../../../domain/projectFilterValues';
import { LibraryProject } from '../libraryProject';
describe('PublicLibraryComponent', () => {
let component: PublicLibraryComponent;
let fixture: ComponentFixture<PublicLibraryComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [PublicLibraryComponent],
providers: [
MockProvider(LibraryService, {
filterValuesUpdated$: of(),
communityLibraryProjectsSource$: of([
{ id: 1, name: 'P1' },
{ id: 2, name: 'P2' }
] as LibraryProject[]),
officialLibraryProjectsSource$: of([
{ id: 1, name: 'P1' },
{ id: 3, name: 'P3' }
] as LibraryProject[]),
getFilterValues: () => new ProjectFilterValues()
})
]
}).compileComponents();
fixture = TestBed.createComponent(PublicLibraryComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should remove duplicate units', () => {
expect(component['projects'].length).toBe(3);
});
});