Skip to content

Commit

Permalink
Remove troublesome and frankly pointless test step
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyEPhipps committed Sep 27, 2023
1 parent 40a28c6 commit 101d9dd
Show file tree
Hide file tree
Showing 46 changed files with 19 additions and 489 deletions.
19 changes: 4 additions & 15 deletions cypress/e2e/components/atoms/button.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ describe('Button component', () => {

describe('props and methods section', () => {
beforeEach(() => {
cy.visit('/#button');
cy.get('[data-testid="Button-container"] button[name="rsg-usage"]')
.contains('Props & methods')
.as('propsBtn');
Expand Down Expand Up @@ -35,6 +36,7 @@ describe('Button component', () => {

describe('Plain Button: Button-example-0', () => {
beforeEach(() => {
cy.visit('/#button');
cy.get('[data-testid="Button-example-0"')
.as('container')
.find('[class^=rsg--preview]')
Expand Down Expand Up @@ -63,17 +65,11 @@ describe('Button component', () => {
.find('textarea')
.should('exist');
});

it('closes code on click', () => {
cy.get('@viewCodeBtn').click();
cy.get('@container')
.find('textarea')
.should('not.exist');
});
});

describe('Button as a span: Button-example-1', () => {
beforeEach(() => {
cy.visit('/#button');
cy.get('[data-testid="Button-example-1"]')
.as('container')
.find('[class^=rsg--preview]')
Expand All @@ -86,7 +82,7 @@ describe('Button component', () => {
});

it('renders button as a span', () => {
//verify button as a span
// verify button as a span
cy.get('[data-testid="Button-example-1"]')
.contains('My button as a span')
.should('exist');
Expand All @@ -102,12 +98,5 @@ describe('Button component', () => {
.find('textarea')
.should('exist');
});

it('closes code on click', () => {
cy.get('@viewCodeBtn').click();
cy.get('@container')
.find('textarea')
.should('not.exist');
});
});
});
16 changes: 5 additions & 11 deletions cypress/e2e/components/atoms/buttonWithStates.cy.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
describe('Button With States component', () => {
before(() => {
// go to Button With States component
cy.visit('/#button');
// go to Button With States component
cy.visit('/#button');
});

describe('props and methods section', () => {
beforeEach(() => {
cy.visit('/#button');
cy.get('[data-testid="ButtonWithStates-container"]')
.as('container')
.find('[class^=rsg--preview]')
Expand All @@ -26,10 +27,10 @@ describe('Button With States component', () => {
});

it('renders button as disabled', () => {
//verify button as a span
// verify button as a span
cy.get('[data-testid="ButtonWithStates-example-1"]')
.contains('Loading')
.should('be.disabled')
.should('be.disabled');
});

it('has view code button', () => {
Expand All @@ -42,12 +43,5 @@ describe('Button With States component', () => {
.find('textarea')
.should('exist');
});

it('closes code on click', () => {
cy.get('@viewCodeBtn').click();
cy.get('@container')
.find('textarea')
.should('not.exist');
});
});
});
2 changes: 2 additions & 0 deletions cypress/e2e/components/atoms/checkbox.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ describe('Checkbox component', () => {

describe('props and methods section', () => {
beforeEach(() => {
cy.visit('/#checkbox');
cy.get('[data-testid="Checkbox-container"] button[name="rsg-usage"]')
.contains('Props & methods')
.as('propsBtn');
Expand Down Expand Up @@ -35,6 +36,7 @@ describe('Checkbox component', () => {

describe('Checkbox section', () => {
beforeEach(() => {
cy.visit('/#checkbox');
cy.get('[data-preview="Checkbox"]')
.as('preview');
});
Expand Down
10 changes: 2 additions & 8 deletions cypress/e2e/components/atoms/confetti.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ describe('Confetti component', () => {

describe('props and methods section', () => {
beforeEach(() => {
cy.visit('/#confetti');
cy.get('[data-testid="Confetti-container"]')
.as('container')
.find('[class^=rsg--preview]')
Expand All @@ -25,7 +26,7 @@ describe('Confetti component', () => {
});

it('renders confetti when "trigger confetti" is clicked', () => {
//verify button as a span
// verify button as a span
cy.get('[data-testid="Confetti-example-1"]')
.contains('trigger confetti')
.click()
Expand All @@ -41,12 +42,5 @@ describe('Confetti component', () => {
.find('textarea')
.should('exist');
});

it('closes code on click', () => {
cy.get('@viewCodeBtn').click();
cy.get('@container')
.find('textarea')
.should('not.exist');
});
});
});
8 changes: 1 addition & 7 deletions cypress/e2e/components/atoms/errorText.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ describe('ErrorText component', () => {

describe('props and methods section', () => {
beforeEach(() => {
cy.visit('/#errortext');
cy.get('[data-testid="ErrorText-container"]')
.as('container')
.find('[class^=rsg--preview]')
Expand Down Expand Up @@ -40,12 +41,5 @@ describe('ErrorText component', () => {
.find('textarea')
.should('exist');
});

it('closes code on click', () => {
cy.get('@viewCodeBtn').click();
cy.get('@container')
.find('textarea')
.should('not.exist');
});
});
});
18 changes: 4 additions & 14 deletions cypress/e2e/components/atoms/input.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ describe('Input component', () => {

describe('props and methods section', () => {
beforeEach(() => {
cy.visit('/#input');
cy.get('[data-testid="Input-container"] button[name="rsg-usage"]')
.contains('Props & methods')
.as('propsBtn');
Expand Down Expand Up @@ -35,6 +36,7 @@ describe('Input component', () => {

describe('Input preview section: required with label and hint', () => {
beforeEach(() => {
cy.visit('/#input');
cy.get('[data-testid="Input-example-0"]')
.as('container')
.find('[class^=rsg--preview]')
Expand Down Expand Up @@ -69,17 +71,11 @@ describe('Input component', () => {
.find('textarea')
.should('exist');
});

it('closes code on click', () => {
cy.get('@viewCodeBtn').click();
cy.get('@container')
.find('textarea')
.should('not.exist');
});
});

describe('Input preview section: with error message', () => {
beforeEach(() => {
cy.visit('/#input');
cy.get('[data-testid="Input-example-1"]')
.as('container')
.find('[data-preview="Input"]')
Expand Down Expand Up @@ -126,6 +122,7 @@ describe('Input component', () => {

describe('Input preview section: with simple input(optional)', () => {
beforeEach(() => {
cy.visit('/#input');
cy.get('[data-testid="Input-example-2"]')
.as('container')
.find('[class^=rsg--preview]')
Expand Down Expand Up @@ -156,12 +153,5 @@ describe('Input component', () => {
.find('textarea')
.should('exist');
});

it('closes code on click', () => {
cy.get('@viewCodeBtn').click();
cy.get('@container')
.find('textarea')
.should('not.exist');
});
});
});
14 changes: 0 additions & 14 deletions cypress/e2e/components/atoms/label.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ describe('Label component', () => {
.find('textarea')
.should('exist');
});

it('closes code on click', () => {
cy.get('@viewCodeBtn').click();
cy.get('@container')
.find('textarea')
.should('not.exist');
});
});

describe('Wrapping a styled input: Label-example-1', () => {
Expand Down Expand Up @@ -93,12 +86,5 @@ describe('Label component', () => {
.find('textarea')
.should('exist');
});

it('closes code on click', () => {
cy.get('@viewCodeBtn').click();
cy.get('@container')
.find('textarea')
.should('not.exist');
});
});
});
21 changes: 0 additions & 21 deletions cypress/e2e/components/atoms/link.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,6 @@ describe('Link component', () => {
.find('textarea')
.should('exist');
});

it('closes code on click', () => {
cy.get('@viewCodeBtn').click();
cy.get('@container')
.find('textarea')
.should('not.exist');
});
});

describe('Iconography section', () => {
Expand Down Expand Up @@ -134,13 +127,6 @@ describe('Link component', () => {
.find('textarea')
.should('exist');
});

it('closes code on click', () => {
cy.get('@viewCodeBtn').click();
cy.get('@container')
.find('textarea')
.should('not.exist');
});
});

describe('Link as button section', () => {
Expand Down Expand Up @@ -196,12 +182,5 @@ describe('Link component', () => {
.find('textarea')
.should('exist');
});

it('closes code on click', () => {
cy.get('@viewCodeBtn').click();
cy.get('@container')
.find('textarea')
.should('not.exist');
});
});
});
21 changes: 0 additions & 21 deletions cypress/e2e/components/atoms/logo.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,6 @@ describe('Logo component', () => {
.find('textarea')
.should('exist');
});

it('closes code on click', () => {
cy.get('@viewCodeBtn').click();
cy.get('@container')
.find('textarea')
.should('not.exist');
});
});

describe('SR logo section', () => {
Expand Down Expand Up @@ -100,13 +93,6 @@ describe('Logo component', () => {
.find('textarea')
.should('exist');
});

it('closes code on click', () => {
cy.get('@viewCodeBtn').click();
cy.get('@container')
.find('textarea')
.should('not.exist');
});
});

describe('SR game on logo section', () => {
Expand Down Expand Up @@ -138,12 +124,5 @@ describe('Logo component', () => {
.find('textarea')
.should('exist');
});

it('closes code on click', () => {
cy.get('@viewCodeBtn').click();
cy.get('@container')
.find('textarea')
.should('not.exist');
});
});
});
28 changes: 0 additions & 28 deletions cypress/e2e/components/atoms/pagination.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,6 @@ describe('Pagination component', () => {
.find('textarea')
.should('exist');
});

it('closes code on click', () => {
cy.get('@viewCodeBtn').click();
cy.get('@container')
.find('textarea')
.should('not.exist');
});
});

describe('Pagination full size section', () => {
Expand Down Expand Up @@ -109,13 +102,6 @@ describe('Pagination component', () => {
.find('textarea')
.should('exist');
});

it('closes code on click', () => {
cy.get('@viewCodeBtn').click();
cy.get('@container')
.find('textarea')
.should('not.exist');
});
});

describe('Pagination custom style section', () => {
Expand Down Expand Up @@ -156,13 +142,6 @@ describe('Pagination component', () => {
.find('textarea')
.should('exist');
});

it('closes code on click', () => {
cy.get('@viewCodeBtn').click();
cy.get('@container')
.find('textarea')
.should('not.exist');
});
});

describe('Pagination custom labels section', () => {
Expand Down Expand Up @@ -203,12 +182,5 @@ describe('Pagination component', () => {
.find('textarea')
.should('exist');
});

it('closes code on click', () => {
cy.get('@viewCodeBtn').click();
cy.get('@container')
.find('textarea')
.should('not.exist');
});
});
});
Loading

0 comments on commit 101d9dd

Please sign in to comment.