Skip to content

Commit

Permalink
test(e2e-storybook): fix feature-card e2e skipped tests and make them… (
Browse files Browse the repository at this point in the history
#12130)

… valid

### Related Ticket(s)

Closes # 
[/issues/12121](#12121)

### Description

The e2e-storybook tests have been failing for quite awhile. The tests do not appear to have been updated for v2. In many cases, the tests are using the old v1 prefixes.

The goal here is:

- Fix all skipped tests and align them with what we have in v2.

### Changelog

**New**

- Updated e2e-storybook for feature-card component so that all skipped tests are now running and correctly and doing the proper checkage
  • Loading branch information
bruno-amorim authored Dec 2, 2024
1 parent f8dda62 commit 41999ed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export const Large = (args) => {
</c4d-image>
<c4d-card-eyebrow>${eyebrow}</c4d-card-eyebrow>
<c4d-card-heading>${heading}</c4d-card-heading>
${copy && html`<p></p>`}
${copy ? html`<p>${copy}</p>` : ''}
<c4d-feature-card-footer> </c4d-feature-card-footer>
</c4d-feature-card>
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ describe('c4d-feature-card | medium', () => {
});
});

it.skip('should have image on the left and content on the right side of the card', () => {
it('should have image on the left and content on the right side of the card', () => {
// image takes the left half
cy.get('c4d-image').then(($image) => {
expect($image[0].getBoundingClientRect().left).to.equal(32);
expect($image[0].getBoundingClientRect().left).to.equal(33);
expect($image[0].getBoundingClientRect().right).to.equal(328);
});

Expand All @@ -75,7 +75,7 @@ describe('c4d-feature-card | medium', () => {
.find('.cds--card__wrapper')
.then(($content) => {
expect($content[0].getBoundingClientRect().left).to.equal(328);
expect($content[0].getBoundingClientRect().right).to.equal(624);
expect($content[0].getBoundingClientRect().right).to.equal(623);
});
});

Expand Down Expand Up @@ -161,16 +161,17 @@ describe('c4d-feature-card | large', () => {
});
});

it.skip('should have eyebrow, heading, and copy content', () => {
it('should have eyebrow, heading, and copy content', () => {
cy.get('c4d-card-eyebrow').invoke('text').should('not.be.empty');
cy.get('c4d-card-heading').invoke('text').should('not.be.empty');
cy.get('c4d-feature-card > p').invoke('text').should('not.be.empty');
});


it.skip('should have image on the left and content on the right half of the card', () => {
it('should have image on the left and content on the right half of the card', () => {
// image takes the left half
cy.get('c4d-image').then(($image) => {
expect($image[0].getBoundingClientRect().left).to.equal(16);
expect($image[0].getBoundingClientRect().left).to.equal(33);
expect($image[0].getBoundingClientRect().right).to.equal(529);
});

Expand All @@ -180,7 +181,7 @@ describe('c4d-feature-card | large', () => {
.find('.cds--card__wrapper')
.then(($content) => {
expect($content[0].getBoundingClientRect().left).to.equal(529);
expect($content[0].getBoundingClientRect().right).to.equal(1042);
expect($content[0].getBoundingClientRect().right).to.equal(1025);
});
});

Expand Down

0 comments on commit 41999ed

Please sign in to comment.