-
Notifications
You must be signed in to change notification settings - Fork 111
fix: update VTU to v1, update types #139
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
Merged
afontcu
merged 10 commits into
testing-library:master
from
afenton90:vue-test-utils-upgrade
May 20, 2020
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8231b0d
feat(@vue/test-utils): upgrade to v1
afenton90 1582bc6
refactor(vtu): upgrade to 1.0.2
afenton90 0ac8f26
Update build-related packages
afontcu 8d76484
Remove removed sync option
afontcu 13ba03e
Bump DOM Testing Library
afontcu d47df70
Bump to VTU 1.0.3
afontcu 902d899
Fix Vuetify test
afontcu 3831452
Remove test unrelated to Vuetify
afontcu d6087aa
Bump DTL patch version
afontcu dc38df6
Add @afenton90 as a contributor
afontcu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Hm, did this test start to fail? 🤔 I mean, did Vuetify changed anything? I'm worried this is related to
attachTo
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.
Yeah it did start to fail. When I debugged though it seemed like once menu list was open it just added display none to hide it.
Let me debug with
attachToDocument
to see what it was outputtingThere 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.
So with
master
this works fine. Using debug shows that themenu item
is removed from the DOM.However, with the latest version of VTU and
attachToDocument
still show this in the DOM.So looks like an issue with the latest release of VTU rather than use of
attachTo
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.
Ok, I spent some time on this. The breaking change is actually from
vue/[email protected]
->vue/[email protected]
.I will debug a bit more.
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.
Don't ask how I figured this out but THIS LINE is the problem. Adding it back in fixes this test.
I do not know why this was removed or what this line does.
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.
Hey! 👋 yeah, I'm currently looking into it. I started to think that
toBeInTheDocument()
was actually not the right assertion.AFAICT, Vuetify does render the element but hides it, so
toBeInTheDocument()
should have passed. Now, I don't have much experience with Vuetify, so I might be wrong.I am unable, though, to make this pass (and I think it should):
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.
@afontcu so just tried the menu in a project I have locally, the browser behaviour is:
v-menu
does not appear in the documentv-text-field
.v-menu
is inserted into the DOMv-menu
is still in the DOM but hasdisplay: none
So the edit to the test looks valid based on this behaviour.
Looks like the test before was reporting a false positive.
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.
Yes! That's what I thought, too 🙌 . The snippet I posted above is currently failing, I'll try to dig a bit more and see if I can figure out why. Thought it could have something to with transitions, even though I tried with
<v-menu :transition="false" />
but nothing changed.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.
Tried a lot of different versions of this test, then figured:
Turns out the definition of this "working" is that it renders with
display: none
even when clicked whilst testing with VTU.There is a snapshot here with
display: none
https://github.com/vuetifyjs/vuetify/blob/9ac1158f857fd1f531f1177ba623602973f81b55/packages/vuetify/src/components/VMenu/__tests__/__snapshots__/VMenu.spec.ts.snap#L15With the corresponding test here https://github.com/vuetifyjs/vuetify/blob/9ac1158f857fd1f531f1177ba623602973f81b55/packages/vuetify/src/components/VMenu/__tests__/VMenu.spec.ts#L32
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.
okay, this is interesting. Now I'm leaning towards simplifying our Vuetify test (which is only aimed at showing a way of configuring VTL and Vuetify) to make it more resilient. If they are happy with
display:none
, we should be, too. I'm gonna push some changes soon to this branch, and make the test pass.Thanks for your help, @afenton90! Much appreciated :)