diff --git a/src/__tests__/update-props.js b/src/__tests__/update-props.js index edaf1593..737d1af8 100644 --- a/src/__tests__/update-props.js +++ b/src/__tests__/update-props.js @@ -14,9 +14,11 @@ test('calling render with the same component but different props does not remoun expect(getByTestId('number-display')).toHaveTextContent('1') await updateProps({number: 2}) - expect(getByTestId('number-display')).toHaveTextContent('2') + await updateProps({number: 3}) + expect(getByTestId('number-display')).toHaveTextContent('3') + // Assert that, even after updating props, the component hasn't remounted, // meaning we are testing the same component instance we rendered initially. expect(getByTestId('instance-id')).toHaveTextContent('1') diff --git a/src/vue-testing-library.js b/src/vue-testing-library.js index 5c69e103..a9425f8e 100644 --- a/src/vue-testing-library.js +++ b/src/vue-testing-library.js @@ -80,10 +80,7 @@ function render( isUnmounted: () => wrapper.vm._isDestroyed, html: () => wrapper.html(), emitted: () => wrapper.emitted(), - updateProps: _ => { - wrapper.setProps(_) - return waitFor(() => {}) - }, + updateProps: _ => wrapper.setProps(_), ...getQueriesForElement(baseElement), } }