This repository has been archived by the owner on Nov 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(floating-label): add snapshots (#263)
- Loading branch information
1 parent
c335269
commit 4a2b41f
Showing
2 changed files
with
44 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import 'mutationobserver-shim' | ||
import { mount } from '@vue/test-utils' | ||
import FloatingLabel from '../FloatingLabel.vue' | ||
|
||
describe('FloatingLabel', () => { | ||
it('should mount', () => { | ||
let wrapper = mount(FloatingLabel) | ||
expect(wrapper.isVueInstance()).toBeTruthy() | ||
expect(wrapper.vm.$data.mdcFloatingLabel).toBeDefined() | ||
}) | ||
|
||
it('should render with no prop', () => { | ||
let wrapper = mount(FloatingLabel) | ||
expect(wrapper).toMatchSnapshot() | ||
expect(wrapper.classes()).toContain('mdc-floating-label') | ||
}) | ||
|
||
it('should render with floatAbove', () => { | ||
let wrapper = mount(FloatingLabel, { | ||
propsData: { | ||
floatAbove: true | ||
} | ||
}) | ||
expect(wrapper).toMatchSnapshot() | ||
expect(wrapper.classes()).toContain('mdc-floating-label--float-above') | ||
}) | ||
|
||
it('should render with shake', () => { | ||
let wrapper = mount(FloatingLabel, { | ||
propsData: { | ||
shake: true | ||
} | ||
}) | ||
expect(wrapper).toMatchSnapshot() | ||
expect(wrapper.classes()).toContain('mdc-floating-label--shake') | ||
}) | ||
}) |
7 changes: 7 additions & 0 deletions
7
components/floating-label/__test__/__snapshots__/FloatingLabel.spec.js.snap
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,7 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`FloatingLabel should render with floatAbove 1`] = `<label class="mdc-floating-label mdc-floating-label--float-above"></label>`; | ||
|
||
exports[`FloatingLabel should render with no prop 1`] = `<label class="mdc-floating-label"></label>`; | ||
|
||
exports[`FloatingLabel should render with shake 1`] = `<label class="mdc-floating-label mdc-floating-label--shake"></label>`; |