]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/services/telemetry-notification.service.spec.ts
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / services / telemetry-notification.service.spec.ts
1 import { TestBed } from '@angular/core/testing';
2
3 import { configureTestBed } from '~/testing/unit-test-helper';
4 import { TelemetryNotificationService } from './telemetry-notification.service';
5
6 describe('TelemetryNotificationService', () => {
7 let service: TelemetryNotificationService;
8
9 configureTestBed({
10 providers: [TelemetryNotificationService]
11 });
12
13 beforeEach(() => {
14 service = TestBed.inject(TelemetryNotificationService);
15 spyOn(service.update, 'emit');
16 });
17
18 it('should be created', () => {
19 expect(service).toBeTruthy();
20 });
21
22 it('should set notification visibility to true', () => {
23 service.setVisibility(true);
24 expect(service.visible).toBe(true);
25 expect(service.update.emit).toHaveBeenCalledWith(true);
26 });
27
28 it('should set notification visibility to false', () => {
29 service.setVisibility(false);
30 expect(service.visible).toBe(false);
31 expect(service.update.emit).toHaveBeenCalledWith(false);
32 });
33 });