File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ <script >
2+ export default {
3+ name: ' FunctionalSFCRender' ,
4+ functional: true ,
5+ render (createElement , { $style }) {
6+ return createElement (' div' , {
7+ class: [$style .ModuleClass ]
8+ })
9+ }
10+ }
11+ </script >
12+
13+ <style lang="scss" module>
14+ .ModuleClass {
15+ width : auto ;
16+ }
17+ </style >
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import jestVue from 'vue-jest'
66import RenderFunction from './components/RenderFunction.vue'
77import Jade from './components/Jade.vue'
88import FunctionalSFC from './components/FunctionalSFC.vue'
9+ import FunctionalSFCRender from './components/FunctionalSFCRender.vue'
910import Basic from './components/Basic.vue'
1011import BasicSrc from './components/BasicSrc.vue'
1112import { randomExport } from './components/NamedExport.vue'
@@ -92,6 +93,12 @@ test('processes functional components', () => {
9293 expect ( clickSpy ) . toHaveBeenCalledWith ( 1 )
9394} )
9495
96+ test ( 'processes functional components using render function' , ( ) => {
97+ const wrapper = mount ( FunctionalSFCRender )
98+ const CSS_CLASSES = [ 'ModuleClass' ]
99+ expect ( wrapper . classes ( ) . toString ( ) ) . toBe ( CSS_CLASSES . toString ( ) )
100+ } )
101+
95102test ( 'processes SFC with functional template from parent' , ( ) => {
96103 const wrapper = mount ( FunctionalSFCParent )
97104 expect ( wrapper . text ( ) . trim ( ) ) . toBe ( 'foo' )
You can’t perform that action at this time.
0 commit comments