Skip to content

Commit 0d25142

Browse files
committed
Rename updateProps to setProps to align with VTU
1 parent 6e03a09 commit 0d25142

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/__tests__/update-props.js renamed to src/__tests__/set-props.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ import NumberDisplay from './components/NumberDisplay.vue'
77
// That said, if you'd prefer to update the props of a rendered component, this
88
// function can be used to update props of the rendered component.
99
test('calling render with the same component but different props does not remount', async () => {
10-
const {getByTestId, updateProps} = render(NumberDisplay, {
10+
const {getByTestId, setProps} = render(NumberDisplay, {
1111
props: {number: 1},
1212
})
1313

1414
expect(getByTestId('number-display')).toHaveTextContent('1')
1515

16-
await updateProps({number: 2})
16+
await setProps({number: 2})
1717

1818
expect(getByTestId('number-display')).toHaveTextContent('2')
1919

src/vue-testing-library.js

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ function render(
8888
wrapper.setProps(_)
8989
return waitFor(() => {})
9090
},
91+
setProps: props => wrapper.setProps(props),
9192
...getQueriesForElement(baseElement),
9293
}
9394
}

0 commit comments

Comments
 (0)