-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add styles support for vue3-jest (#369)
- Loading branch information
Showing
9 changed files
with
84 additions
and
87 deletions.
There are no files selected for viewing
This file contains 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 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 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,21 +1,15 @@ | ||
// import { createApp, h } from 'vue' | ||
|
||
// import Scss from './components/Scss.vue' | ||
|
||
// function mount(Component, props, slots) { | ||
// document.getElementsByTagName('html')[0].innerHTML = '' | ||
// const el = document.createElement('div') | ||
// el.id = 'app' | ||
// document.body.appendChild(el) | ||
// const Parent = { | ||
// render() { | ||
// return h(Component, props, slots) | ||
// } | ||
// } | ||
// createApp(Parent).mount(el) | ||
// } | ||
|
||
// TODO: Figure this out with Vue 3. `$style` no longer exists. | ||
test.todo('processes SCSS using user specified post transforms') | ||
|
||
test.todo('processes SCSS using user specified pre transforms') | ||
import { mount } from '@vue/test-utils' | ||
import Scss from './components/Scss.vue' | ||
|
||
test('processes SCSS using user specified post transforms', () => { | ||
const wrapper = mount(Scss) | ||
expect(wrapper.vm.$style.light.a).toBeUndefined() | ||
expect(wrapper.vm.$style.light.f).toEqual('f') | ||
expect(wrapper.vm.$style.dark.f).toEqual('f') | ||
expect(wrapper.vm.$style.dark.g).toEqual('g') | ||
}) | ||
|
||
test('processes SCSS using user specified pre transforms', () => { | ||
const wrapper = mount(Scss) | ||
expect(wrapper.vm.$style.g).toEqual('g') | ||
}) |
This file contains 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 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 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 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 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 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