]> git.proxmox.com Git - ceph.git/blame - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/custom-login-banner.service.spec.ts
import ceph quincy 17.2.1
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / api / custom-login-banner.service.spec.ts
CommitLineData
33c7a0ef
TL
1import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
2import { TestBed } from '@angular/core/testing';
3
4import { configureTestBed } from '~/testing/unit-test-helper';
5import { CustomLoginBannerService } from './custom-login-banner.service';
6
7describe('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});