-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[unit testing] table calls provider only once when filter is object #4067
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #4067 +/- ##
=======================================
Coverage 99.86% 99.86%
=======================================
Files 238 238
Lines 4475 4475
Branches 1260 1260
=======================================
Hits 4469 4469
Misses 5 5
Partials 1 1
Continue to review full report at Codecov.
|
If prop |
The fields are defined. I can update the tests to check it. |
PR #4068 may fix this issue |
Also note that the EDIT: object is allowed when provider filtering is happening |
// the provider is being called twice | ||
expect(providerCallCount).toBe(2) | ||
|
||
filter.a = '456'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just setting this will not update the prop in Vue Test Utils. you need to call setProps on the wrapper
wrapper.setProps({ filter: filter })
return testItems.slice() | ||
} | ||
|
||
mount(BTable, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When mounting, assign the return value to wrapper
, so that it can be destroyed at the end of the test. otherwise it remains in the DOM during the other tests (and occupies memory space as well)
Confirmed: PR #4068 fixes your original issue re provider being called twice when filter is preset before mount and |
Describe the PR
A clear and concise description of what the pull request does.
PR checklist
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
The PR fulfills these requirements:
dev
branch, not themaster
branch[...] (fixes #xxx[,#xxx])
, where "xxx" is the issue number)fix(alert): not alerting during SSR render
,docs(badge): update pill examples, fix typos
,chore: fix typo in README
, etc). This is very important, as theCHANGELOG
is generated from these messages.If new features/enhancement/fixes are added or changed:
package.json
for slot and event changes)If adding a new feature, or changing the functionality of an existing feature, the PR's
description above includes: