@@ -256,6 +256,37 @@ describe("DocumentParser", function() {
256
256
} ) ;
257
257
} ) ;
258
258
259
+ describe ( 'parses runtime' , function ( ) {
260
+ it ( 'amp-story' , function ( ) {
261
+ const document = parse ( '<html ⚡>' , '<body>' , '<amp-story standalone>' , '</amp-story>' , '</body>' ) ;
262
+ expect ( document . isAmpStory ) . toBe ( true ) ;
263
+ expect ( document . isAmpWeb ) . toBe ( true ) ;
264
+ expect ( document . isAmpEmail ) . toBe ( false ) ;
265
+ expect ( document . isAmpAds ) . toBe ( false ) ;
266
+ } ) ;
267
+ it ( 'amp-mail' , function ( ) {
268
+ const document = parse ( '<html ⚡4email>' , '<body>' , '</body>' ) ;
269
+ expect ( document . isAmpStory ) . toBe ( false ) ;
270
+ expect ( document . isAmpWeb ) . toBe ( false ) ;
271
+ expect ( document . isAmpEmail ) . toBe ( true ) ;
272
+ expect ( document . isAmpAds ) . toBe ( false ) ;
273
+ } ) ;
274
+ it ( 'amp-ad' , function ( ) {
275
+ const document = parse ( '<html ⚡4ads>' , '<body>' , '</body>' ) ;
276
+ expect ( document . isAmpStory ) . toBe ( false ) ;
277
+ expect ( document . isAmpWeb ) . toBe ( false ) ;
278
+ expect ( document . isAmpEmail ) . toBe ( false ) ;
279
+ expect ( document . isAmpAds ) . toBe ( true ) ;
280
+ } ) ;
281
+ it ( 'amp-web' , function ( ) {
282
+ const document = parse ( '<html ⚡>' , '<body>' , '</body>' ) ;
283
+ expect ( document . isAmpStory ) . toBe ( false ) ;
284
+ expect ( document . isAmpWeb ) . toBe ( true ) ;
285
+ expect ( document . isAmpEmail ) . toBe ( false ) ;
286
+ expect ( document . isAmpAds ) . toBe ( false ) ;
287
+ } ) ;
288
+ } ) ;
289
+
259
290
function newSection ( comment , doc , preview , isFirstSection , isLastSection ) {
260
291
const section = new CodeSection ( comment , doc , preview ) ;
261
292
section . isLastSection = isLastSection ;
0 commit comments