-
Notifications
You must be signed in to change notification settings - Fork 669
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: find functional components in shallow (#408)
- Loading branch information
1 parent
f8ce240
commit 20465ab
Showing
78 changed files
with
490 additions
and
474 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions
6
test/unit/specs/mount/Wrapper/at.spec.js → test/specs/wrapper/at.spec.js
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
10 changes: 5 additions & 5 deletions
10
...it/specs/mount/Wrapper/attributes.spec.js → test/specs/wrapper/attributes.spec.js
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
11 changes: 5 additions & 6 deletions
11
.../unit/specs/mount/Wrapper/classes.spec.js → test/specs/wrapper/classes.spec.js
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,24 +1,23 @@ | ||
|
||
import { describeWithShallowAndMount } from '~resources/test-utils' | ||
import { compileToFunctions } from 'vue-template-compiler' | ||
import { mount } from '~vue-test-utils' | ||
import ComponentWithCssModules from '~resources/components/component-with-css-modules.vue' | ||
|
||
describe('classes', () => { | ||
describeWithShallowAndMount('classes', (mountingMethod) => { | ||
it('returns array of class names if wrapper has class names', () => { | ||
const compiled = compileToFunctions('<div class="a-class b-class" />') | ||
const wrapper = mount(compiled) | ||
const wrapper = mountingMethod(compiled) | ||
expect(wrapper.classes()).to.contain('a-class') | ||
expect(wrapper.classes()).to.contain('b-class') | ||
}) | ||
|
||
it('returns empty array if wrapper has no classes', () => { | ||
const compiled = compileToFunctions('<div />') | ||
const wrapper = mount(compiled) | ||
const wrapper = mountingMethod(compiled) | ||
expect(wrapper.classes().length).to.equal(0) | ||
}) | ||
|
||
it('returns original class names when element mapped in css modules', () => { | ||
const wrapper = mount(ComponentWithCssModules) | ||
const wrapper = mountingMethod(ComponentWithCssModules) | ||
expect(wrapper.classes()).to.eql(['extension', 'color-red']) | ||
}) | ||
}) |
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
Oops, something went wrong.