We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc5db6f commit 1cff4a5Copy full SHA for 1cff4a5
src/app/core/services/alert.service.spec.ts
@@ -1,5 +1,7 @@
1
import { TestBed } from '@angular/core/testing';
2
3
+import { IAlert } from '@interfaces/alert.interface';
4
+
5
import { AlertService } from './alert.service';
6
7
describe('AlertService', () => {
@@ -13,4 +15,15 @@ describe('AlertService', () => {
13
15
it('should be created', () => {
14
16
expect(service).toBeTruthy();
17
});
18
19
+ it('should emit an alert', () => {
20
+ const alert: IAlert = {
21
+ type: 'success',
22
+ message: 'Test alert',
23
+ };
24
+ service.alert.subscribe((data) => {
25
+ expect(data).toEqual(alert);
26
+ });
27
+ service.emitAlert(alert);
28
29
0 commit comments