Issues with triggering ok event in modal after updating to vue test utils 30
See original GitHub issueDescribe the bug
I am having issues with testing ok event in bootstrap modal after upgrade to vue test utils (version 30). I have code with modal and button. It tests that action is called on ok event. It worked in version 29 but stopped in 30.
Steps to reproduce the bug
- Clone https://github.com/Loremaster/bootstrap-vue-modal-submit-vtu-30
- Run
$ yarn
- Run
$ yarn test:unit
- See error:
expect(jest.fn()).toHaveBeenCalledWith(...expected)
Expected: Anything, "Reminder message"
Number of calls: 0
30 | await flushPromises();
31 |
> 32 | expect(actions.createReminder).toHaveBeenCalledWith(expect.anything(), "Reminder message");
| ^
33 | });
34 | });
Expected behavior
I can see that clicking on button doesn’t trigger submit for some reason.
Versions
Libraries:
- BootstrapVue: 2.2.2
- Bootstrap: 4.4.1
- Vue: 2.6.11
Demo link
Repo: https://github.com/Loremaster/bootstrap-vue-modal-submit-vtu-30
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How do you open a bootstrap-vue modal with vue-test-utils?
I'm trying to open the modal with wrapper.find('#modal-1').trigger('click') . I've tried using a directive <b-button v-b-modal.modal ...
Read more >Guides | Vue Test Utils
This means that you must wait for updates to run after you change a reactive property. You can do that by awaiting mutation...
Read more >How to call component method from another component vue js
But I Dec 05, 2019 · Call a Vue. js file which should trigger the modal ... is not a function Details: mount...
Read more >Chapter 5. Testing events - Testing Vue.js Applications
To learn how to test DOM events, you'll write tests for the Modal component. ... You can do that with the Vue Test...
Read more >Changelog - Cypress Documentation
Fixed an issue where updating a component would not trigger the ... Fixes #24298. cy.origin() now supports more than 30 unique origin spec...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I see. Personally I found the fix for me by using
await Vue.nextTick()
together with transitionStub. I will close the issue as I resolved it for me.@tmorehouse hope it helps you guys 😃