File tree Expand file tree Collapse file tree 1 file changed +34
-1
lines changed Expand file tree Collapse file tree 1 file changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -778,7 +778,7 @@ describe('SSR: renderToString', () => {
778
778
expect ( vm . a ) . toBe ( func )
779
779
} )
780
780
781
- it ( 'should prevent xss in attribtues' , ( ) => {
781
+ it ( 'should prevent xss in attribtues' , done => {
782
782
renderVmWithOptions ( {
783
783
data : {
784
784
xss : '"><script>alert(1)</script>'
@@ -790,6 +790,39 @@ describe('SSR: renderToString', () => {
790
790
`
791
791
} , res => {
792
792
expect ( res ) . not . toContain ( `<script>alert(1)</script>` )
793
+ done ( )
794
+ } )
795
+ } )
796
+
797
+ it ( 'template v-if' , done => {
798
+ renderVmWithOptions ( {
799
+ template : `
800
+ <div>
801
+ <span>foo</span>
802
+ <template v-if="true">
803
+ <span>foo</span> bar <span>baz</span>
804
+ </template>
805
+ </div>
806
+ `
807
+ } , res => {
808
+ expect ( res ) . toContain ( `<div data-server-rendered="true"><span>foo</span> <span>foo</span> bar <span>baz</span></div>` )
809
+ done ( )
810
+ } )
811
+ } )
812
+
813
+ it ( 'template v-for' , done => {
814
+ renderVmWithOptions ( {
815
+ template : `
816
+ <div>
817
+ <span>foo</span>
818
+ <template v-for="i in 2">
819
+ <span>{{ i }}</span><span>bar</span>
820
+ </template>
821
+ </div>
822
+ `
823
+ } , res => {
824
+ expect ( res ) . toContain ( `<div data-server-rendered="true"><span>foo</span> <span>1</span><span>bar</span><span>2</span><span>bar</span></div>` )
825
+ done ( )
793
826
} )
794
827
} )
795
828
} )
You can’t perform that action at this time.
0 commit comments