question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issues with triggering ok event in modal after updating to vue test utils 30

See original GitHub issue

Describe 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

  1. Clone https://github.com/Loremaster/bootstrap-vue-modal-submit-vtu-30
  2. Run $ yarn
  3. Run $ yarn test:unit
  4. 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:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Loremastercommented, Jan 22, 2020

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.

0reactions
Loremastercommented, Jan 22, 2020

@tmorehouse hope it helps you guys 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found