File tree 4 files changed +57
-0
lines changed
4 files changed +57
-0
lines changed Original file line number Diff line number Diff line change @@ -671,4 +671,10 @@ export declare class CWidgetSimple extends Vue {
671
671
text : string
672
672
}
673
673
674
+ export declare class CWrapper extends Vue {
675
+ fluid : boolean
676
+ tag : string
677
+ }
678
+
679
+
674
680
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <component :is =" tag" :class =" classList" >
3
+ <slot ></slot >
4
+ </component >
5
+ </template >
6
+
7
+ <script >
8
+ export default {
9
+ name: ' CWrapper' ,
10
+ props: {
11
+ tag: {
12
+ type: String ,
13
+ default: ' div'
14
+ },
15
+ fluid: {
16
+ type: Boolean ,
17
+ default: false
18
+ }
19
+ },
20
+ computed: {
21
+ classList () {
22
+ return [
23
+ ' c-wrapper' ,
24
+ { ' c-wrapper-fluid' : this .fluid }
25
+ ]
26
+ }
27
+ }
28
+ }
29
+ </script >
Original file line number Diff line number Diff line change
1
+ import { mount } from '@vue/test-utils'
2
+ import Component from '../CWrapper'
3
+
4
+ const ComponentName = 'CWrapper'
5
+ const wrapper = mount ( Component )
6
+
7
+
8
+ describe ( `${ ComponentName } .vue` , ( ) => {
9
+ it ( 'has a name' , ( ) => {
10
+ expect ( Component . name ) . toBe ( ComponentName )
11
+ } )
12
+ it ( 'renders correctly' , ( ) => {
13
+ expect ( wrapper . element ) . toMatchSnapshot ( )
14
+ } )
15
+ } )
Original file line number Diff line number Diff line change
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports [` CWrapper.vue renders correctly 1` ] = `
4
+ <div
5
+ class = " c-wrapper c-fixed-components"
6
+ />
7
+ ` ;
You can’t perform that action at this time.
0 commit comments