This repository was archived by the owner on Nov 30, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed
components/floating-label/__test__ Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ import 'mutationobserver-shim'
2
+ import { mount } from '@vue/test-utils'
3
+ import FloatingLabel from '../FloatingLabel.vue'
4
+
5
+ describe ( 'FloatingLabel' , ( ) => {
6
+ it ( 'should mount' , ( ) => {
7
+ let wrapper = mount ( FloatingLabel )
8
+ expect ( wrapper . isVueInstance ( ) ) . toBeTruthy ( )
9
+ expect ( wrapper . vm . $data . mdcFloatingLabel ) . toBeDefined ( )
10
+ } )
11
+
12
+ it ( 'should render with no prop' , ( ) => {
13
+ let wrapper = mount ( FloatingLabel )
14
+ expect ( wrapper ) . toMatchSnapshot ( )
15
+ expect ( wrapper . classes ( ) ) . toContain ( 'mdc-floating-label' )
16
+ } )
17
+
18
+ it ( 'should render with floatAbove' , ( ) => {
19
+ let wrapper = mount ( FloatingLabel , {
20
+ propsData : {
21
+ floatAbove : true
22
+ }
23
+ } )
24
+ expect ( wrapper ) . toMatchSnapshot ( )
25
+ expect ( wrapper . classes ( ) ) . toContain ( 'mdc-floating-label--float-above' )
26
+ } )
27
+
28
+ it ( 'should render with shake' , ( ) => {
29
+ let wrapper = mount ( FloatingLabel , {
30
+ propsData : {
31
+ shake : true
32
+ }
33
+ } )
34
+ expect ( wrapper ) . toMatchSnapshot ( )
35
+ expect ( wrapper . classes ( ) ) . toContain ( 'mdc-floating-label--shake' )
36
+ } )
37
+ } )
Original file line number Diff line number Diff line change
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports [` FloatingLabel should render with floatAbove 1` ] = ` <label class = " mdc-floating-label mdc-floating-label--float-above" ></label >` ;
4
+
5
+ exports [` FloatingLabel should render with no prop 1` ] = ` <label class = " mdc-floating-label" ></label >` ;
6
+
7
+ exports [` FloatingLabel should render with shake 1` ] = ` <label class = " mdc-floating-label mdc-floating-label--shake" ></label >` ;
You can’t perform that action at this time.
0 commit comments