]>
Commit | Line | Data |
---|---|---|
33c7a0ef TL |
1 | import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; |
2 | import { TestBed } from '@angular/core/testing'; | |
3 | ||
4 | import { configureTestBed } from '~/testing/unit-test-helper'; | |
5 | import { CustomLoginBannerService } from './custom-login-banner.service'; | |
6 | ||
7 | describe('CustomLoginBannerService', () => { | |
8 | let service: CustomLoginBannerService; | |
9 | let httpTesting: HttpTestingController; | |
10 | const baseUiURL = 'ui-api/login/custom_banner'; | |
11 | ||
12 | configureTestBed({ | |
13 | providers: [CustomLoginBannerService], | |
14 | imports: [HttpClientTestingModule] | |
15 | }); | |
16 | ||
17 | beforeEach(() => { | |
18 | service = TestBed.inject(CustomLoginBannerService); | |
19 | httpTesting = TestBed.inject(HttpTestingController); | |
20 | }); | |
21 | ||
22 | afterEach(() => { | |
23 | httpTesting.verify(); | |
24 | }); | |
25 | ||
26 | it('should be created', () => { | |
27 | expect(service).toBeTruthy(); | |
28 | }); | |
29 | ||
30 | it('should call getBannerText', () => { | |
31 | service.getBannerText().subscribe(); | |
32 | const req = httpTesting.expectOne(baseUiURL); | |
33 | expect(req.request.method).toBe('GET'); | |
34 | }); | |
35 | }); |