Skip to content

Commit

Permalink
#27494 Adding announcement test has been read test
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelrojas committed Feb 8, 2024
1 parent a280503 commit e6e264e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ describe('AnnouncementsStore', () => {
announcementDateAsISO8601: '2024-01-31T17:51',
identifier: 'test-announcement-id',
inode: '123',
url: 'https://www.example.com'
url: 'https://www.example.com',
hasBeenRead: false
}
]
})
Expand All @@ -51,12 +52,14 @@ describe('AnnouncementsStore', () => {
announcementDateAsISO8601: '2024-01-31T17:51',
identifier: 'test-announcement-id',
inode: '123',
hasBeenRead: false,
url: 'https://www.example.com?utm_source=platform&utm_medium=announcement&utm_campaign=demo.dotcms.com'
}
];
spectator.service.load();
spectator.service.state$.subscribe((state) => {
expect(state.announcements).toEqual(mockAnnouncements);
expect(state.announcements[0].hasBeenRead).toBe(false);
done();
});
});
Expand All @@ -68,6 +71,7 @@ describe('AnnouncementsStore', () => {

spectator.service.state$.subscribe((state) => {
expect(state.showUnreadAnnouncement).toBe(false);
expect(state.announcements[0].hasBeenRead).toBe(true);
done();
});
});
Expand Down

0 comments on commit e6e264e

Please sign in to comment.