-
Notifications
You must be signed in to change notification settings - Fork 111
[PoC] VTL@next: Update to Vue 3.0 and Vue Test Utils 2.0 #137
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
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
c41507f
Bump Vue and VTU
afontcu a1b91ed
Identify TODOs
afontcu 76c6624
Allow propsData (mark as breaking change)
afontcu ecfc251
Remove removed method
afontcu e9d5f95
Fix fire-event tests
afontcu 9d1663e
Add basic TS config (is this needed?)
afontcu 3659de3
Add link to related issue
afontcu e2ae9c8
Fix form.vue (not sure how this is related to Vue3?
afontcu 75b58a2
Remove unrelated test – we need to add a cleaner way to test unmount
afontcu 2175993
Fix inline snapshot
afontcu 23730bc
Fix stubs test
afontcu ee56d98
Rename updateProps to setProps to align with VTU
afontcu 8ab20b3
Bump deps
afontcu b2c597c
Silence third-party tests
afontcu fa3b7bf
Remove outdated comment
afontcu a1fca69
Comment out tests that relies on vue2 initialization and setting up
afontcu 7af298a
Comment out vue-apollo (relies on vue2)
afontcu 650ff5a
Comment out test that rely on vue2
afontcu 09adb61
Comment out potential deprecated test
afontcu b80926b
Cleanup template
afontcu 2b07210
Fix autocleanup tests
afontcu 9e26a03
Fix warning on onsubmit jsdom
afontcu 8483889
Bump vue deps
afontcu a333bba
Fix failing stubs tests
afontcu 690df45
Update deps
afontcu 553a8b0
Rename lifecycle method
afontcu 1a6274d
Fix directive example
afontcu 34e276e
Remove updateProps
afontcu e61a9ae
Simplify the slots example
afontcu 347a30b
Fix functional tests
afontcu 108b8b6
Add POC for Vuex 4
afontcu e8b1b02
Update vue-i18n example
afontcu 49f6639
Fix snapshots
afontcu 1496dd1
Fix vee-validate tests
afontcu 90c3772
Add missing test for unmount
afontcu 13497b3
Remove propsData
afontcu e054728
Remove isUnmounted
afontcu 6e490c0
Add composition API example
afontcu 5c98617
Bump deps
afontcu 93768a4
Remove localVue references
afontcu 47d3f0a
Bump vtu-next
afontcu 8e06631
Comment out unused features (router)
afontcu 38f53ae
Update deps
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,25 @@ | ||
import {render, cleanup} from '@testing-library/vue' | ||
import Vue from 'vue' | ||
test.todo('check if this test still makes sense') | ||
|
||
test('cleanup re-throws errors from async lifecycle hooks', async () => { | ||
const err = new Error('foo') | ||
render({ | ||
async mounted() { | ||
await new Promise((resolve, reject) => { | ||
reject(err) | ||
}) | ||
}, | ||
template: `<h1>Hello World</h1>`, | ||
}) | ||
// thrown errors are logged redundantly by vue-test-utils injected Vue.config.errorHandler | ||
// mute console | ||
const spy = jest.spyOn(console, 'error').mockImplementation(() => {}) | ||
// import {render, cleanup} from '@testing-library/vue' | ||
// import {nextTick} from 'vue' | ||
|
||
await Vue.nextTick() | ||
expect(cleanup).toThrow(err) | ||
// test('cleanup re-throws errors from async lifecycle hooks', async () => { | ||
// const err = new Error('foo') | ||
// render({ | ||
// async mounted() { | ||
// await new Promise((resolve, reject) => { | ||
// reject(err) | ||
// }) | ||
// }, | ||
// template: `<h1>Hello World</h1>`, | ||
// }) | ||
// // thrown errors are logged redundantly by vue-test-utils injected Vue.config.errorHandler | ||
// // mute console | ||
// const spy = jest.spyOn(console, 'error').mockImplementation(() => {}) | ||
|
||
// unmute console | ||
spy.mockReset() | ||
}) | ||
// await nextTick() | ||
// expect(cleanup).toThrow(err) | ||
|
||
// // unmute console | ||
// spy.mockReset() | ||
// }) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,6 @@ | ||
<template> | ||
<div class="card"> | ||
<slot name="header" /> | ||
<slot :content="content"> | ||
<!-- Fallback content if no default slot is given --> | ||
<p>Nothing used the {{ content }}</p> | ||
</slot> | ||
<slot name="footer" /> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
// For the sake of demoing scopedSlots, this Card component | ||
// passes a simple string down to its default slot. | ||
export default { | ||
data() { | ||
return { | ||
content: 'Scoped content!' | ||
} | ||
} | ||
} | ||
</script> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,73 @@ | ||
<template> | ||
<div> | ||
<h1>Movie Review</h1> | ||
<form @submit.prevent="submit"> | ||
<label for="movie-input">Title of the movie</label> | ||
<input id="movie-input" v-model="title" name="title" /> | ||
<label id="review-textarea">Your review</label> | ||
<textarea | ||
v-model="review" | ||
name="review-textarea" | ||
placeholder="Write an awesome review" | ||
aria-labelledby="review-textarea" | ||
/> | ||
<label> | ||
<input v-model="rating" type="radio" value="3" /> | ||
Wonderful | ||
</label> | ||
<label> | ||
<input v-model="rating" type="radio" value="2" /> | ||
Average | ||
</label> | ||
<label> | ||
<input v-model="rating" type="radio" value="1" /> | ||
Awful | ||
</label> | ||
<label id="recommend-label">Would you recommend this movie?</label> | ||
<input | ||
id="recommend" | ||
v-model="recommend" | ||
type="checkbox" | ||
name="recommend" | ||
/> | ||
<button :disabled="submitDisabled" type="submit"> | ||
Submit | ||
</button> | ||
</form> | ||
</div> | ||
</template> | ||
<script> | ||
export default { | ||
data() { | ||
return { | ||
title: '', | ||
review: '', | ||
rating: '1', | ||
recommend: false, | ||
} | ||
}, | ||
computed: { | ||
submitDisabled() { | ||
return !this.title || !this.review | ||
}, | ||
}, | ||
methods: { | ||
submit() { | ||
if (this.submitDisabled) return | ||
this.$emit('submit', { | ||
title: this.title, | ||
review: this.review, | ||
rating: this.rating, | ||
recommend: this.recommend, | ||
}) | ||
}, | ||
}, | ||
} | ||
</script> | ||
<template> | ||
<div> | ||
<h1>Movie Review</h1> | ||
<form onsubmit="return false"> | ||
<label for="movie-input">Title of the movie</label> | ||
<input id="movie-input" v-model="title" name="title" /> | ||
|
||
<label id="review-textarea">Your review</label> | ||
<textarea | ||
v-model="review" | ||
name="review-textarea" | ||
placeholder="Write an awesome review" | ||
aria-labelledby="review-textarea" | ||
/> | ||
|
||
<label> | ||
<input v-model="rating" type="radio" value="3" /> | ||
Wonderful | ||
</label> | ||
<label> | ||
<input v-model="rating" type="radio" value="2" /> | ||
Average | ||
</label> | ||
<label> | ||
<input v-model="rating" type="radio" value="1" /> | ||
Awful | ||
</label> | ||
|
||
<label id="recommend-label">Would you recommend this movie?</label> | ||
<input | ||
id="recommend" | ||
v-model="recommend" | ||
type="checkbox" | ||
name="recommend" | ||
/> | ||
|
||
<button :disabled="submitDisabled" type="submit" @click="submit"> | ||
Submit | ||
</button> | ||
</form> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
data() { | ||
return { | ||
title: '', | ||
review: '', | ||
rating: '1', | ||
recommend: false, | ||
} | ||
}, | ||
computed: { | ||
submitDisabled() { | ||
return !this.title || !this.review | ||
}, | ||
}, | ||
|
||
methods: { | ||
submit() { | ||
if (this.submitDisabled) return | ||
|
||
this.$emit('submit', { | ||
title: this.title, | ||
review: this.review, | ||
rating: this.rating, | ||
recommend: this.recommend, | ||
}) | ||
}, | ||
}, | ||
} | ||
</script> |
Oops, something went wrong.
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.
re: #142