forked from patternfly/patternfly-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotificationbadge.spec.ts
28 lines (26 loc) · 983 Bytes
/
notificationbadge.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
describe('Notification Badge Demo Test', () => {
it('Navigate to notificatoin badge demo section', () => {
cy.visit('http://localhost:3000/');
cy.get('#notification-badge-demo-nav-item-link').click();
cy.url().should('eq', 'http://localhost:3000/notification-badge-demo-nav-link');
});
it('Verify notification badge is unread', () => {
cy.get('.pf-c-notification-badge')
.first()
.should('have.class', 'pf-m-unread');
cy.get('.pf-c-notification-badge')
.last()
.should('have.class', 'pf-m-attention');
cy.get('.pf-c-notification-badge__count').contains('30');
});
it('Verify notification badge is read after click', () => {
cy.get('#notification-demo-badge1').click();
cy.get('.pf-c-notification-badge')
.first()
.should('have.class', 'pf-m-read');
cy.get('#notification-demo-badge2').click();
cy.get('.pf-c-notification-badge')
.last()
.should('have.class', 'pf-m-read');
});
});