-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from dfcook/mount-options
Support all mount options in vue-test-utils
- Loading branch information
Showing
9 changed files
with
66 additions
and
26 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
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,31 +1,33 @@ | ||
<template> | ||
<button :class="typeClass" @click="clicked">{{ text }}</button> | ||
<button | ||
:class="typeClass" | ||
@click="clicked" | ||
>{{ text }}</button> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: { | ||
text: { | ||
type: String, | ||
default: '', | ||
default: '' | ||
}, | ||
clicked: { | ||
type: Function, | ||
default: () => true | ||
}, | ||
type: { | ||
validator: (value) => ['primary', 'secondary'].includes(value), | ||
}, | ||
default: 'primary' | ||
} | ||
}, | ||
computed: { | ||
typeClass: function() { | ||
typeClass: function () { | ||
if (this.type) { | ||
return `button button--${this.type}`; | ||
return `button button--${this.type}` | ||
} | ||
return 'button'; | ||
}, | ||
}, | ||
}; | ||
</script> | ||
return 'button' | ||
} | ||
} | ||
} | ||
</script> |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<template> | ||
<form> | ||
<label for="search"> | ||
<FontAwesomeIcon icon="search"/> Search | ||
</label> | ||
<input | ||
id="search" | ||
type="text" | ||
name="search" | ||
> | ||
<VButton text="Search now" /> | ||
</form> | ||
</template> | ||
|
||
<script> | ||
import VButton from './Button' | ||
export default { | ||
name: 'SearchForm', | ||
components: { VButton } | ||
} | ||
</script> |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { render, cleanup } from '../../src' | ||
import Form from './components/Form' | ||
|
||
afterEach(cleanup) | ||
|
||
test('Form contains search button', () => { | ||
const { getByText } = render(Form, { | ||
stubs: ['FontAwesomeIcon'] | ||
}) | ||
getByText('Search now') | ||
}) |
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