Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(masthead-platform): add check if next to logo and contains link #7468

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,27 @@ describe('Masthead | with platform (desktop)', () => {
cy.viewport(1280, 780);
});

it('should contain link', () => {
ariellalgilmore marked this conversation as resolved.
Show resolved Hide resolved
cy.get('[data-autoid="dds--masthead-eco__l0-ecosystemname"]').then(
$link => {
const url = $link.prop('href');
expect(url).not.to.be.empty;
}
);
});

it('should be next to IBM logo', () => {
ariellalgilmore marked this conversation as resolved.
Show resolved Hide resolved
cy.get('[data-autoid="dds--masthead-eco__l0-ecosystemname"]').then(
$platform => {
cy.get('[data-autoid="dds--masthead-eco__l0-logo"]').then($logo => {
expect($logo[0].getBoundingClientRect().right).to.equal(
$platform[0].parentElement.getBoundingClientRect().left
);
});
}
);
});

it('should open the search bar with platform', () => {
cy.get('[data-autoid="dds--masthead-eco__l0-search"]').click();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,24 @@ describe('dds-masthead | with platform (desktop)', () => {
cy.viewport(1280, 780);
});

it('should contain link', () => {
cy.get('dds-masthead > dds-top-nav-name')
.shadow()
.find('a')
.then($link => {
const url = $link.prop('href');
expect(url).not.to.be.empty;
});
});

it('should be next to IBM logo', () => {
cy.get('dds-masthead > dds-top-nav-name').then($platform => {
cy.get('dds-masthead > dds-masthead-logo').then($logo => {
expect($logo[0].getBoundingClientRect().right).to.equal($platform[0].getBoundingClientRect().left);
});
});
});

it('should open the search bar with platform', () => {
cy.get('dds-masthead > dds-search-with-typeahead')
.shadow()
Expand Down