From bfff347601f4deffb35cf6851af0af3242829480 Mon Sep 17 00:00:00 2001 From: pivi Date: Mon, 23 Oct 2023 09:40:51 +0200 Subject: [PATCH] add correct button styling --- cypress/component/integration/Button.cy.tsx | 153 ++++++++++++-------- 1 file changed, 95 insertions(+), 58 deletions(-) diff --git a/cypress/component/integration/Button.cy.tsx b/cypress/component/integration/Button.cy.tsx index 461fee0c..5aa34835 100644 --- a/cypress/component/integration/Button.cy.tsx +++ b/cypress/component/integration/Button.cy.tsx @@ -9,7 +9,11 @@ describe('Component | Integration | Button', function () { describe('primary button without icons', () => { beforeEach(() => { - cy.mount(, +
+ + , +
, ); }); it('should render primary button with both icons and children', () => { cy.get('[data-testid="button"]').should('exist'); cy.get('[data-testid="preIcon"]').should('exist'); cy.get('[data-testid="posIcon"]').should('exist'); - cy.get('[data-testid="children"]').should('exist'); cy.get('[data-testid="children"]').should('contain', 'Children'); }); @@ -80,16 +94,18 @@ describe('Component | Integration | Button', function () { describe('primary button with preIcon with children', () => { beforeEach(() => { cy.mount( - , +
+ + , +
, ); }); it('should render primary button with preIcon and with children', () => { cy.get('[data-testid="button"]').should('exist'); cy.get('[data-testid="preIcon"]').should('exist'); cy.get('[data-testid="posIcon"]').should('not.exist'); - cy.get('[data-testid="children"]').should('exist'); cy.get('[data-testid="children"]').should('contain', 'Children'); }); @@ -101,16 +117,18 @@ describe('Component | Integration | Button', function () { describe('primary button with posIcon with children', () => { beforeEach(() => { cy.mount( - , +
+ + , +
, ); }); it('should render primary button with posIcon and children', () => { cy.get('[data-testid="button"]').should('exist'); cy.get('[data-testid="preIcon"]').should('not.exist'); cy.get('[data-testid="posIcon"]').should('exist'); - cy.get('[data-testid="children"]').should('exist'); cy.get('[data-testid="children"]').should('contain', 'Children'); }); @@ -122,16 +140,18 @@ describe('Component | Integration | Button', function () { describe('primary button without icons and with children', () => { beforeEach(() => { cy.mount( - , +
+ + , +
, ); }); it('should render primary button without icons and children', () => { cy.get('[data-testid="button"]').should('exist'); cy.get('[data-testid="preIcon"]').should('not.exist'); cy.get('[data-testid="posIcon"]').should('not.exist'); - cy.get('[data-testid="children"]').should('exist'); cy.get('[data-testid="children"]').should('contain', 'Children'); }); @@ -144,7 +164,11 @@ describe('Component | Integration | Button', function () { describe('secondary button without icons', () => { beforeEach(() => { - cy.mount(, +
+ + , +
, ); }); it('should render secondary button with both icons and children', () => { cy.get('[data-testid="button"]').should('exist'); cy.get('[data-testid="preIcon"]').should('exist'); cy.get('[data-testid="posIcon"]').should('exist'); - cy.get('[data-testid="children"]').should('exist'); cy.get('[data-testid="children"]').should('contain', 'Children'); }); @@ -228,43 +260,46 @@ describe('Component | Integration | Button', function () { describe('secondary button with preIcon with children', () => { beforeEach(() => { cy.mount( - , +
+ +
, ); }); it('should render secondary button with preIcon and with children', () => { cy.get('[data-testid="button"]').should('exist'); cy.get('[data-testid="preIcon"]').should('exist'); cy.get('[data-testid="posIcon"]').should('not.exist'); - cy.get('[data-testid="children"]').should('exist'); cy.get('[data-testid="children"]').should('contain', 'Children'); }); it('should match snapshot', () => { - compareSnapshot(cy, 'primary-button-with-preIcon-with-children'); + compareSnapshot(cy, 'secondary-button-with-preIcon-with-children'); }); }); describe('secondary button with posIcon with children', () => { beforeEach(() => { cy.mount( - , +
+ + , +
, ); }); it('should render secondary button with posIcon and children', () => { cy.get('[data-testid="button"]').should('exist'); cy.get('[data-testid="preIcon"]').should('not.exist'); cy.get('[data-testid="posIcon"]').should('exist'); - cy.get('[data-testid="children"]').should('exist'); cy.get('[data-testid="children"]').should('contain', 'Children'); }); @@ -276,16 +311,18 @@ describe('Component | Integration | Button', function () { describe('secondary button without icons and with children', () => { beforeEach(() => { cy.mount( - , +
+ + , +
, ); }); it('should render secondary button without icons and children', () => { cy.get('[data-testid="button"]').should('exist'); cy.get('[data-testid="preIcon"]').should('not.exist'); cy.get('[data-testid="posIcon"]').should('not.exist'); - cy.get('[data-testid="children"]').should('exist'); cy.get('[data-testid="children"]').should('contain', 'Children'); });