]> git.proxmox.com Git - ceph.git/blame - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/motd.service.spec.ts
import ceph quincy 17.2.4
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / api / motd.service.spec.ts
CommitLineData
522d829b
TL
1import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
2import { TestBed } from '@angular/core/testing';
3
4import { MotdService } from '~/app/shared/api/motd.service';
5import { configureTestBed } from '~/testing/unit-test-helper';
6
7describe('MotdService', () => {
8 let service: MotdService;
9 let httpTesting: HttpTestingController;
10
11 configureTestBed({
12 imports: [HttpClientTestingModule],
13 providers: [MotdService]
14 });
15
16 beforeEach(() => {
17 service = TestBed.inject(MotdService);
18 httpTesting = TestBed.inject(HttpTestingController);
19 });
20
21 afterEach(() => {
22 httpTesting.verify();
23 });
24
25 it('should be created', () => {
26 expect(service).toBeTruthy();
27 });
28
29 it('should get MOTD', () => {
30 service.get().subscribe();
31 const req = httpTesting.expectOne('ui-api/motd');
32 expect(req.request.method).toBe('GET');
33 });
34});