Newer
Older
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { TranslateModule } from '@ngx-translate/core';
import { ActivatedRoute } from '@angular/router';
import { of as observableOf } from 'rxjs/internal/observable/of';
import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';
import { CommunityRolesComponent } from './community-roles.component';
import { Community } from '../../../core/shared/community.model';
import { By } from '@angular/platform-browser';
import { RemoteData } from '../../../core/data/remote-data';
describe('CommunityRolesComponent', () => {
let fixture: ComponentFixture<CommunityRolesComponent>;
let comp: CommunityRolesComponent;
let de: DebugElement;
beforeEach(() => {
const route = {
parent: {
data: observableOf({
dso: new RemoteData(
false,
false,
true,
undefined,
new Community(),
)
})
}
};
TestBed.configureTestingModule({
imports: [
TranslateModule.forRoot(),
],
declarations: [
CommunityRolesComponent,
],
providers: [
{ provide: ActivatedRoute, useValue: route },
],
schemas: [NO_ERRORS_SCHEMA]
}).compileComponents();
fixture = TestBed.createComponent(CommunityRolesComponent);
comp = fixture.componentInstance;
de = fixture.debugElement;
fixture.detectChanges();
});
it('should display a community admin role component', () => {
expect(de.query(By.css('ds-comcol-role.admin'))).toBeDefined();
});
});