forked from patternfly/patternfly-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
breadcrumb.spec.ts
44 lines (38 loc) · 1.36 KB
/
breadcrumb.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
describe('Breadcrumb Demo Test', () => {
it('Navigate to demo section', () => {
cy.visit('http://localhost:3000/');
cy.get('#breadcrumb-demo-nav-item-link').click();
cy.url().should('eq', 'http://localhost:3000/breadcrumb-demo-nav-link');
});
it('Verify breadcrumb items have link', () => {
cy.get('li')
.children('a')
.should('not.be.undefined');
cy.get('li')
.children('a')
.should('not.equal', null);
});
it('Verify dropdown breadcrumb item', () => {
cy.get('#badge-dropdown div').should('have.class', 'pf-c-dropdown');
});
it('Verify default section home content', () => {
cy.get('.pf-c-breadcrumb__link')
.first()
.contains('Section Home');
});
it('Verify default section label defaults', () => {
cy.get('.pf-c-breadcrumb__link').contains('Section Title');
});
it('Verify render props in Fake Section Title ', () => {
cy.get('span.pf-c-breadcrumb__link').contains('Fake Section Title');
cy.get('span.pf-c-breadcrumb__link').should('not.have.attr', 'aria-current');
cy.get('span.pf-c-breadcrumb__link').should('have.attr', 'data-href', '/hello');
});
it('Verify Section Home takes user to home page', () => {
cy.get('.pf-c-breadcrumb__link')
.first()
.contains('Section Home')
.click();
cy.url().should('eq', 'http://localhost:3000/');
});
});