Skip to content

Commit bcd6b8d

Browse files
author
Kent C. Dodds
committed
fix: revert previous commit because it should've been a major version
Revert "feat: upgrade to dom-testing-library@4.0.0 (#41)" This reverts commit 8df980e.
1 parent 8df980e commit bcd6b8d

File tree

3 files changed

+52
-42
lines changed

3 files changed

+52
-42
lines changed

cypress/integration/commands.spec.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ describe('dom-testing-library commands', () => {
88
.type('Hello Placeholder')
99
})
1010

11+
it('getByText', () => {
12+
cy.getByText('Button Text').click()
13+
})
14+
1115
it('getByLabelText', () => {
1216
cy.getByLabelText('Label For Input Labelled By Id')
1317
.click()
@@ -27,10 +31,8 @@ describe('dom-testing-library commands', () => {
2731
})
2832

2933
it('queryByText', () => {
30-
cy.queryAllByText('Button Text').should('exist')
31-
cy.queryByText('Non-existing Button Text', {timeout: 100}).should(
32-
'not.exist',
33-
)
34+
cy.queryByText('Button Text').should('exist')
35+
cy.queryByText('Non-existing Button Text').should('not.exist')
3436
})
3537

3638
it('getByText within', () => {
@@ -52,7 +54,7 @@ describe('dom-testing-library commands', () => {
5254
expect(err.message).to.eq(errorMessage)
5355
})
5456

55-
cy.getByTestId(testId, {timeout: 100}).click()
57+
cy.getByTestId(testId).click()
5658
})
5759

5860
it('getByText only throws the error message', () => {
@@ -62,7 +64,7 @@ describe('dom-testing-library commands', () => {
6264
expect(err.message).to.eq(errorMessage)
6365
})
6466

65-
cy.getByText('Some random text', {timeout: 100}).click()
67+
cy.getByText('Some random text').click()
6668
})
6769
})
6870

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@
5050
"license": "MIT",
5151
"dependencies": {
5252
"@babel/runtime": "^7.4.3",
53-
"dom-testing-library": "^4.0.0"
53+
"dom-testing-library": "^3.12.4"
5454
},
5555
"devDependencies": {
5656
"cypress": "3.2.0",
57-
"dtslint": "^0.7.1",
58-
"kcd-scripts": "^1.2.2",
57+
"dtslint": "^0.6.0",
58+
"kcd-scripts": "^1.1.3",
5959
"npm-run-all": "^4.1.2",
6060
"serve": "^11.0.0",
61-
"typescript": "^3.4.5",
61+
"typescript": "^3.1.6",
6262
"wait-port": "^0.2.2"
6363
},
6464
"peerDependencies": {

src/__tests__/__snapshots__/commands.js.snap

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,61 @@
22

33
exports[`exports expected commands 1`] = `
44
Array [
5-
"queryAllByLabelText",
6-
"getAllByLabelText",
7-
"queryByLabelText",
8-
"getByLabelText",
9-
"findAllByLabelText",
10-
"findByLabelText",
11-
"queryByPlaceholderText",
12-
"queryAllByPlaceholderText",
135
"getByPlaceholderText",
146
"getAllByPlaceholderText",
15-
"findAllByPlaceholderText",
16-
"findByPlaceholderText",
17-
"queryAllByText",
187
"queryByText",
8+
"queryAllByText",
199
"getByText",
2010
"getAllByText",
21-
"findAllByText",
22-
"findByText",
23-
"queryAllByDisplayValue",
24-
"queryByDisplayValue",
25-
"getByDisplayValue",
26-
"getAllByDisplayValue",
27-
"findAllByDisplayValue",
28-
"findByDisplayValue",
29-
"queryAllByAltText",
11+
"queryByLabelText",
12+
"queryAllByLabelText",
13+
"getByLabelText",
14+
"getAllByLabelText",
3015
"queryByAltText",
16+
"queryAllByAltText",
3117
"getByAltText",
3218
"getAllByAltText",
33-
"findAllByAltText",
34-
"findByAltText",
35-
"queryAllByTitle",
19+
"queryBySelectText",
20+
"queryAllBySelectText",
21+
"getBySelectText",
22+
"getAllBySelectText",
23+
"getByTestId",
24+
"getAllByTestId",
3625
"queryByTitle",
26+
"queryAllByTitle",
3727
"getByTitle",
3828
"getAllByTitle",
39-
"findAllByTitle",
40-
"findByTitle",
41-
"queryByRole",
42-
"queryAllByRole",
29+
"getByValue",
30+
"getAllByValue",
31+
"queryByDisplayValue",
32+
"queryAllByDisplayValue",
33+
"getByDisplayValue",
34+
"getAllByDisplayValue",
4335
"getAllByRole",
4436
"getByRole",
45-
"findAllByRole",
37+
"findByLabelText",
38+
"findAllByLabelText",
39+
"findByPlaceholderText",
40+
"findAllByPlaceholderText",
41+
"findByText",
42+
"findAllByText",
43+
"findByAltText",
44+
"findAllByAltText",
45+
"findByTitle",
46+
"findAllByTitle",
47+
"findByDisplayValue",
48+
"findAllByDisplayValue",
4649
"findByRole",
50+
"findAllByRole",
51+
"findByTestId",
52+
"findAllByTestId",
53+
"queryByPlaceholderText",
54+
"queryAllByPlaceholderText",
4755
"queryByTestId",
4856
"queryAllByTestId",
49-
"getByTestId",
50-
"getAllByTestId",
51-
"findAllByTestId",
52-
"findByTestId",
57+
"queryByValue",
58+
"queryAllByValue",
59+
"queryByRole",
60+
"queryAllByRole",
5361
]
5462
`;

0 commit comments

Comments
 (0)