From 41999edcedb4ea00e2d59c19693752c0c4d57587 Mon Sep 17 00:00:00 2001 From: bruno-amorim Date: Mon, 2 Dec 2024 18:45:44 -0300 Subject: [PATCH] =?UTF-8?q?test(e2e-storybook):=20fix=20feature-card=20e2e?= =?UTF-8?q?=20skipped=20tests=20and=20make=20them=E2=80=A6=20(#12130)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … valid ### Related Ticket(s) Closes # [/issues/12121](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/issues/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 --- .../__stories__/feature-card.stories.ts | 2 +- .../integration/feature-card/feature-card.e2e.js | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/web-components/src/components/feature-card/__stories__/feature-card.stories.ts b/packages/web-components/src/components/feature-card/__stories__/feature-card.stories.ts index be5d9aebde6..886f9160955 100644 --- a/packages/web-components/src/components/feature-card/__stories__/feature-card.stories.ts +++ b/packages/web-components/src/components/feature-card/__stories__/feature-card.stories.ts @@ -96,7 +96,7 @@ export const Large = (args) => { ${eyebrow} ${heading} - ${copy && html`

`} + ${copy ? html`

${copy}

` : ''} `; diff --git a/packages/web-components/tests/e2e-storybook/cypress/integration/feature-card/feature-card.e2e.js b/packages/web-components/tests/e2e-storybook/cypress/integration/feature-card/feature-card.e2e.js index efe89a4b5c8..fdd56450121 100644 --- a/packages/web-components/tests/e2e-storybook/cypress/integration/feature-card/feature-card.e2e.js +++ b/packages/web-components/tests/e2e-storybook/cypress/integration/feature-card/feature-card.e2e.js @@ -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); }); @@ -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); }); }); @@ -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); }); @@ -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); }); });