diff options
Diffstat (limited to 'src/pybind/mgr/dashboard/frontend/src/app/shared/services/telemetry-notification.service.spec.ts')
-rw-r--r-- | src/pybind/mgr/dashboard/frontend/src/app/shared/services/telemetry-notification.service.spec.ts | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/telemetry-notification.service.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/telemetry-notification.service.spec.ts new file mode 100644 index 000000000..ea1f910e1 --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/telemetry-notification.service.spec.ts @@ -0,0 +1,33 @@ +import { TestBed } from '@angular/core/testing'; + +import { configureTestBed } from '~/testing/unit-test-helper'; +import { TelemetryNotificationService } from './telemetry-notification.service'; + +describe('TelemetryNotificationService', () => { + let service: TelemetryNotificationService; + + configureTestBed({ + providers: [TelemetryNotificationService] + }); + + beforeEach(() => { + service = TestBed.inject(TelemetryNotificationService); + spyOn(service.update, 'emit'); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); + + it('should set notification visibility to true', () => { + service.setVisibility(true); + expect(service.visible).toBe(true); + expect(service.update.emit).toHaveBeenCalledWith(true); + }); + + it('should set notification visibility to false', () => { + service.setVisibility(false); + expect(service.visible).toBe(false); + expect(service.update.emit).toHaveBeenCalledWith(false); + }); +}); |