-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add support for <style> and the Stylus lang * Add Stylus as dev dependency * Add test for vanilla CSS * Group styles HOCs into one single HOC * Fix typo in test name * Move style definition to beforeCreate in order to allow for usage in other parts of the lifecycle * Stop importing classes for non-module CSS
- Loading branch information
1 parent
7791d8e
commit 6ad9553
Showing
5 changed files
with
55 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,21 @@ | ||
import { shallow } from 'vue-test-utils' | ||
import Css from './resources/Css.vue' | ||
|
||
test('processes .vue file with Css style', () => { | ||
const wrapper = shallow(Css) | ||
expect(wrapper.classes()).toContain('testA') | ||
expect(wrapper.classes()).toContain('testB') | ||
describe('processes .vue file with Css style', () => { | ||
let wrapper | ||
beforeAll(() => { | ||
wrapper = shallow(Css) | ||
}) | ||
|
||
it('should bind from style tags with named module', () => { | ||
expect(wrapper.classes()).toContain('testA') | ||
}) | ||
|
||
it('should bind from style tags with anonymous modules', () => { | ||
expect(wrapper.classes()).toContain('testB') | ||
}) | ||
|
||
it('should not bind from style tags without a module', () => { | ||
expect(wrapper.vm.$style.testC).toBeFalsy() | ||
}) | ||
}) |
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,8 +1,21 @@ | ||
import { shallow } from 'vue-test-utils' | ||
import Stylus from './resources/Stylus.vue' | ||
|
||
test('processes .vue file with Stylus style', () => { | ||
const wrapper = shallow(Stylus) | ||
expect(wrapper.classes()).toContain('testA') | ||
expect(wrapper.classes()).toContain('testB') | ||
describe('processes .vue file with Stylus style', () => { | ||
let wrapper | ||
beforeAll(() => { | ||
wrapper = shallow(Stylus) | ||
}) | ||
|
||
it('should bind from style tags with named module', () => { | ||
expect(wrapper.classes()).toContain('testA') | ||
}) | ||
|
||
it('should bind from style tags with anonymous modules', () => { | ||
expect(wrapper.classes()).toContain('testB') | ||
}) | ||
|
||
it('should not bind from style tags without a module', () => { | ||
expect(wrapper.vm.$style.testC).toBeFalsy() | ||
}) | ||
}) |