Skip to content

Commit f629d16

Browse files
committed
Update deps
1 parent 75d4084 commit f629d16

File tree

3 files changed

+31
-31
lines changed

3 files changed

+31
-31
lines changed

package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@
4848
"dependencies": {
4949
"@babel/runtime": "^7.12.1",
5050
"@testing-library/dom": "^7.28.1",
51-
"@vue/test-utils": "^2.0.0-beta.11",
51+
"@vue/test-utils": "^2.0.0-beta.12",
5252
"lodash.merge": "^4.6.2"
5353
},
5454
"devDependencies": {
5555
"@babel/plugin-transform-runtime": "^7.12.1",
5656
"@testing-library/jest-dom": "^5.11.5",
57-
"@testing-library/user-event": "^12.2.2",
57+
"@testing-library/user-event": "^12.4.0",
5858
"@types/estree": "0.0.45",
59-
"@vue/compiler-sfc": "^3.0.3",
59+
"@vue/compiler-sfc": "^3.0.4",
6060
"apollo-boost": "^0.4.9",
6161
"apollo-cache-inmemory": "^1.6.6",
6262
"apollo-client": "^2.6.10",
@@ -67,16 +67,16 @@
6767
"graphql-tag": "^2.11.0",
6868
"isomorphic-unfetch": "^3.1.0",
6969
"jest-serializer-vue": "^2.0.2",
70-
"kcd-scripts": "^7.3.0",
70+
"kcd-scripts": "^7.5.1",
7171
"msw": "^0.21.3",
7272
"portal-vue": "^2.1.7",
7373
"typescript": "^4.1.2",
7474
"vee-validate": "^4.0.2",
75-
"vue": "^3.0.3",
75+
"vue": "^3.0.4",
7676
"vue-apollo": "^3.0.5",
7777
"vue-i18n": "^9.0.0-beta.6",
78-
"vue-jest": "^5.0.0-alpha.5",
79-
"vue-router": "^4.0.0-rc.1",
78+
"vue-jest": "^5.0.0-alpha.7",
79+
"vue-router": "^4.0.0-rc.6",
8080
"vuetify": "^2.3.19",
8181
"vuex": "^4.0.0-rc.2"
8282
},

src/__tests__/select.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ test('Select component', async () => {
99

1010
// Get the Select element by using the initially displayed value.
1111
const select = getByDisplayValue('Tyrannosaurus')
12-
expect(select.value).toBe('dino1')
12+
expect(select).toHaveValue('dino1')
1313

1414
// Update it by manually sending a valid option value.
1515
await fireEvent.update(select, 'dino2')
16-
expect(select.value).toBe('dino2')
16+
expect(select).toHaveValue('dino2')
1717

1818
// We can trigger an update event by directly getting the <option> element.
1919
optionElement = getByText('Deinonychus')
2020
await fireEvent.update(optionElement)
21-
expect(select.value).toBe('dino3')
21+
expect(select).toHaveValue('dino3')
2222

2323
// ...even if option is within an <optgroup>.
2424
optionElement = getByText('Diplodocus')
2525
await fireEvent.update(optionElement)
26-
expect(select.value).toBe('dino4')
26+
expect(select).toHaveValue('dino4')
2727
})

src/__tests__/user-event.js

+20-20
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import '@testing-library/jest-dom'
22
import userEvent from '@testing-library/user-event'
3-
import {render} from '..'
3+
import {render, waitFor} from '..'
44
import Form from './components/Form'
55
import Select from './components/Select'
66

@@ -24,49 +24,49 @@ test('User events in a form', async () => {
2424
expect(submitButton).toBeDisabled()
2525

2626
const titleInput = getByLabelText(/title of the movie/i)
27-
await userEvent.type(titleInput, fakeReview.title)
28-
expect(titleInput.value).toEqual(fakeReview.title)
27+
userEvent.type(titleInput, fakeReview.title)
28+
expect(titleInput).toHaveValue(fakeReview.title)
2929

3030
const textArea = getByLabelText(/Your review/i)
31-
await userEvent.type(textArea, 'The t-rex went insane!')
32-
expect(textArea.value).toEqual('The t-rex went insane!')
31+
userEvent.type(textArea, 'The t-rex went insane!')
32+
expect(textArea).toHaveValue('The t-rex went insane!')
3333

34-
await userEvent.clear(textArea)
35-
expect(textArea.value).toEqual('')
36-
await userEvent.type(textArea, fakeReview.review)
37-
expect(textArea.value).toEqual(fakeReview.review)
34+
userEvent.clear(textArea)
35+
expect(textArea).toHaveValue('')
36+
userEvent.type(textArea, fakeReview.review)
37+
expect(textArea).toHaveValue(fakeReview.review)
3838

3939
const initialSelectedRating = getByLabelText(/Awful/i)
4040
const wonderfulRadioInput = getByLabelText(/Wonderful/i)
4141
expect(initialSelectedRating).toBeChecked()
4242
expect(wonderfulRadioInput).not.toBeChecked()
4343

44-
await userEvent.click(wonderfulRadioInput)
44+
userEvent.click(wonderfulRadioInput)
4545
expect(wonderfulRadioInput).toBeChecked()
46-
expect(initialSelectedRating).not.toBeChecked()
46+
await waitFor(() => expect(initialSelectedRating).not.toBeChecked())
4747

4848
const recommendInput = getByLabelText(/Would you recommend this movie?/i)
49-
await userEvent.click(recommendInput)
49+
userEvent.click(recommendInput)
5050
expect(recommendInput).toBeChecked()
5151

5252
userEvent.tab()
5353
expect(submitButton).toHaveFocus()
5454
expect(submitButton).toBeEnabled()
55-
await userEvent.type(submitButton, '{enter}')
55+
userEvent.type(submitButton, '{enter}')
5656
expect(emitted().submit[0][0]).toMatchObject(fakeReview)
5757

5858
expect(console.warn).not.toHaveBeenCalled()
5959
})
6060

61-
test('selecting option with user events', async () => {
61+
test('selecting option with user events', () => {
6262
const {getByDisplayValue} = render(Select)
6363
const select = getByDisplayValue('Tyrannosaurus')
64-
expect(select.value).toBe('dino1')
64+
expect(select).toHaveValue('dino1')
6565

66-
await userEvent.selectOptions(select, 'dino2')
67-
expect(select.value).toBe('dino2')
66+
userEvent.selectOptions(select, 'dino2')
67+
expect(select).toHaveValue('dino2')
6868

69-
await userEvent.selectOptions(select, 'dino3')
70-
expect(select.value).not.toBe('dino2')
71-
expect(select.value).toBe('dino3')
69+
userEvent.selectOptions(select, 'dino3')
70+
expect(select).not.toHaveValue('dino2')
71+
expect(select).toHaveValue('dino3')
7272
})

0 commit comments

Comments
 (0)