|
1 | | -import Stepper from './Stepper'; |
| 1 | +import Stepper from "./Stepper"; |
2 | 2 |
|
3 | | -describe('<Stepper>', () => { |
4 | | - it('mounts', () => { |
| 3 | +describe("<Stepper>", () => { |
| 4 | + it("mounts", () => { |
5 | 5 | cy.mount(<Stepper />); |
6 | 6 | }); |
7 | 7 |
|
8 | | - it('stepper should default to 0', () => { |
| 8 | + it("stepper should default to 0", () => { |
9 | 9 | cy.mount(<Stepper />); |
10 | | - cy.get('[data-cy=counter]').should('have.text', '0'); |
| 10 | + cy.get("[data-cy=counter]").should("have.text", "0"); |
11 | 11 | }); |
12 | 12 |
|
13 | | - it('supports an "initial" prop to set the value', () => { |
14 | | - cy.mount(<Stepper initial={100} />); |
15 | | - cy.get('[data-cy=counter]').should('have.text', '100'); |
| 13 | + it('supports a "count" prop to set the value', () => { |
| 14 | + cy.mount(<Stepper count={100} />); |
| 15 | + cy.get("[data-cy=counter]").should("have.text", "100"); |
16 | 16 | }); |
17 | 17 |
|
18 | | - it('when the increment button is pressed, the counter is incremented', () => { |
| 18 | + it("when the increment button is pressed, the counter is incremented", () => { |
19 | 19 | cy.mount(<Stepper />); |
20 | | - cy.get('[data-cy=increment]').click(); |
21 | | - cy.get('[data-cy=counter]').should('have.text', '1'); |
| 20 | + cy.get("[data-cy=increment]").click(); |
| 21 | + cy.get("[data-cy=counter]").should("have.text", "1"); |
22 | 22 | }); |
23 | 23 |
|
24 | | - it('when the decrement button is pressed, the counter is decremented', () => { |
| 24 | + it("when the decrement button is pressed, the counter is decremented", () => { |
25 | 25 | cy.mount(<Stepper />); |
26 | | - cy.get('[data-cy=decrement]').click(); |
27 | | - cy.get('[data-cy=counter]').should('have.text', '-1'); |
| 26 | + cy.get("[data-cy=decrement]").click(); |
| 27 | + cy.get("[data-cy=counter]").should("have.text", "-1"); |
28 | 28 | }); |
29 | 29 |
|
30 | | - it('clicking + fires a change event with the incremented value', () => { |
31 | | - const onChangeSpy = cy.spy().as('onChangeSpy'); |
| 30 | + it("clicking + fires a change event with the incremented value", () => { |
| 31 | + const onChangeSpy = cy.spy().as("onChangeSpy"); |
32 | 32 | cy.mount(<Stepper onChange={onChangeSpy} />); |
33 | | - cy.get('[data-cy=increment]').click(); |
34 | | - cy.get('@onChangeSpy').should('have.been.calledWith', 1); |
| 33 | + cy.get("[data-cy=increment]").click(); |
| 34 | + cy.get("@onChangeSpy").should("have.been.calledWith", 1); |
35 | 35 | }); |
36 | 36 | }); |
0 commit comments