@@ -116,12 +116,22 @@ const metaInfoData = {
116
116
{ src : 'src1' , async : false , defer : true , [ defaultOptions . tagIDKeyName ] : 'content' , callback : ( ) => { } } ,
117
117
{ src : 'src-prepend' , async : true , defer : false , pbody : true } ,
118
118
{ src : 'src2' , async : false , defer : true , body : true } ,
119
- { src : 'src3' , async : false , skip : true }
119
+ { src : 'src3' , async : false , skip : true } ,
120
+ { type : 'application/ld+json' ,
121
+ json : {
122
+ '@context' : 'http://schema.org' ,
123
+ '@type' : 'Organization' ,
124
+ 'name' : 'MyApp' ,
125
+ 'url' : 'https://www.myurl.com' ,
126
+ 'logo' : 'https://www.myurl.com/images/logo.png'
127
+ }
128
+ }
120
129
] ,
121
130
expect : [
122
131
'<script data-vue-meta="ssr" src="src1" defer data-vmid="content" onload="this.__vm_l=1"></script>' ,
123
132
'<script data-vue-meta="ssr" src="src-prepend" async data-pbody="true"></script>' ,
124
- '<script data-vue-meta="ssr" src="src2" defer data-body="true"></script>'
133
+ '<script data-vue-meta="ssr" src="src2" defer data-body="true"></script>' ,
134
+ '<script data-vue-meta="ssr" type="application/ld+json">{"@context":"http://schema.org","@type":"Organization","name":"MyApp","url":"https://www.myurl.com","logo":"https://www.myurl.com/images/logo.png"}</script>'
125
135
] ,
126
136
test ( side , defaultTest ) {
127
137
return ( ) => {
@@ -139,12 +149,13 @@ const metaInfoData = {
139
149
// ssr doesnt generate data-body tags
140
150
const bodyPrepended = this . expect [ 1 ]
141
151
const bodyAppended = this . expect [ 2 ]
142
- this . expect = [ this . expect [ 0 ] ]
152
+ this . expect = [ this . expect . shift ( ) , this . expect . pop ( ) ]
143
153
144
154
const tags = defaultTest ( )
155
+ const html = tags . text ( )
145
156
146
- expect ( tags . text ( ) ) . not . toContain ( bodyPrepended )
147
- expect ( tags . text ( ) ) . not . toContain ( bodyAppended )
157
+ expect ( html ) . not . toContain ( bodyPrepended )
158
+ expect ( html ) . not . toContain ( bodyAppended )
148
159
}
149
160
}
150
161
}
0 commit comments