-
Notifications
You must be signed in to change notification settings - Fork 188
/
lazy.component.spec.ts
34 lines (28 loc) 路 1.09 KB
/
lazy.component.spec.ts
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
import { waitForAsync, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { TRANSLOCO_SCOPE } from '@jsverse/transloco';
import { getTranslocoModule } from '../transloco-testing.module';
import LazyComponent from './lazy.component';
describe('LazyComponent', () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
providers: [{ provide: TRANSLOCO_SCOPE, useValue: 'admin-page' }],
imports: [getTranslocoModule()],
}).compileComponents();
}));
it('should get scoped title translation', function () {
const fixture = TestBed.createComponent(LazyComponent);
fixture.detectChanges();
expect(
fixture.debugElement.query(By.css('.admin-title')).nativeElement.innerText
).toBe('Admin spanish');
});
it('should get scoped translation with prefix', function () {
const fixture = TestBed.createComponent(LazyComponent);
fixture.detectChanges();
expect(
fixture.debugElement.query(By.css('.admin-prefix')).nativeElement
.innerText
).toBe('Admin prefix spanish');
});
});