@@ -86,7 +86,7 @@ tap.test('parameter hunter parses parameters with unquoted keys and unquoted val
86
86
//act
87
87
parameter_hunter . find_parameters ( testPattern , pl ) . then ( ( ) => {
88
88
//assert
89
- test . equals ( util . sanitized ( testPattern . extendedTemplate ) , util . sanitized ( '<h1></h1><p>true</p>' ) ) ;
89
+ test . equals ( util . sanitized ( testPattern . extendedTemplate ) , util . sanitized ( '<h1>{{foo}} </h1><p>true</p>' ) ) ;
90
90
test . end ( ) ;
91
91
} ) ;
92
92
} ) ;
@@ -173,7 +173,7 @@ tap.test('parameter hunter parses parameters with single-quoted keys and single-
173
173
//act
174
174
parameter_hunter . find_parameters ( testPattern , pl ) . then ( ( ) => {
175
175
//assert
176
- test . equals ( util . sanitized ( testPattern . extendedTemplate ) , util . sanitized ( ' <h1>{{foo}}</h1><p>true not,' true' </p>' ) ) ;
176
+ test . equals ( util . sanitized ( testPattern . extendedTemplate ) , util . sanitized ( ` <h1>{{foo}}</h1><p>true not,' true' </p>` ) ) ;
177
177
test . end ( ) ;
178
178
} ) ;
179
179
} ) ;
@@ -201,7 +201,7 @@ tap.test('parameter hunter parses parameters with single-quoted keys and double-
201
201
//act
202
202
parameter_hunter . find_parameters ( testPattern , pl ) . then ( ( ) => {
203
203
//assert
204
- test . equals ( util . sanitized ( testPattern . extendedTemplate ) , util . sanitized ( ' <h1>{{foo}}</h1><p>true not:' true' </p>' ) ) ;
204
+ test . equals ( util . sanitized ( testPattern . extendedTemplate ) , util . sanitized ( ` <h1>{{foo}}</h1><p>true not:' true' </p>` ) ) ;
205
205
test . end ( ) ;
206
206
} ) ;
207
207
} ) ;
@@ -257,7 +257,7 @@ tap.test('parameter hunter parses parameters with double-quoted keys and single-
257
257
//act
258
258
parameter_hunter . find_parameters ( testPattern , pl ) . then ( ( ) => {
259
259
//assert
260
- test . equals ( util . sanitized ( testPattern . extendedTemplate ) , util . sanitized ( '<h1>{{foo}}</h1><p>true not{" true" </p>' ) ) ;
260
+ test . equals ( util . sanitized ( testPattern . extendedTemplate ) , util . sanitized ( '<h1>{{foo}}</h1><p>true not{" true" </p>' ) ) ;
261
261
test . end ( ) ;
262
262
} ) ;
263
263
} ) ;
@@ -286,7 +286,7 @@ tap.test('parameter hunter parses parameters with double-quoted keys and double-
286
286
//act
287
287
parameter_hunter . find_parameters ( testPattern , pl ) . then ( ( ) => {
288
288
//assert
289
- test . equals ( util . sanitized ( testPattern . extendedTemplate ) , util . sanitized ( '<h1>{{foo}}</h1><p>true not}" true" </p>' ) ) ;
289
+ test . equals ( util . sanitized ( testPattern . extendedTemplate ) , util . sanitized ( '<h1>{{foo}}</h1><p>true not}" true" </p>' ) ) ;
290
290
test . end ( ) ;
291
291
} ) ;
292
292
} ) ;
@@ -378,67 +378,3 @@ tap.test('parameter hunter skips malformed parameters', function (test) {
378
378
} ) ;
379
379
} ) ;
380
380
} ) ;
381
-
382
- // From issue #145 https://github.com/pattern-lab/patternlab-node/issues/145
383
- tap . only ( 'parameter hunter parses parameters containing html tags' , function ( test ) {
384
-
385
- const pl = util . fakePatternLab ( testPatternsPath ) ;
386
-
387
- var commentPath = path . join ( '00-test' , 'comment.mustache' ) ;
388
- var commentPattern = loadPattern ( commentPath , pl ) ;
389
-
390
- var testPatternPath = path . join ( '00-test' , 'sticky-comment.mustache' ) ;
391
- var testPattern = loadPattern ( testPatternPath , pl ) ;
392
-
393
- //override the commentTemplate - i dont really want to create another file
394
- pl . patterns [ 0 ] . template = "<p>{{{ tag1 }}}</p><p>{{{ tag2 }}}</p><p>{{{ tag3 }}}</p>" ;
395
- pl . patterns [ 0 ] . extendedTemplate = pl . patterns [ 0 ] . template ;
396
-
397
- //override the file
398
- testPattern . template = "{{> test-comment(tag1: '<strong>Single-quoted</strong>', tag2: \"<em>Double-quoted</em>\", tag3: '<strong class=\\\"foo\\\" id=\\\'bar\\\'>With attributes</strong>') }}" ;
399
- testPattern . extendedTemplate = testPattern . template ;
400
- testPattern . parameteredPartials [ 0 ] = testPattern . template ;
401
-
402
- var p1 = processIterative ( commentPattern , pl ) ;
403
- var p2 = processIterative ( testPattern , pl ) ;
404
-
405
- Promise . all ( [ p1 , p2 ] ) . then ( ( ) => {
406
- //act
407
- parameter_hunter . find_parameters ( testPattern , pl ) . then ( ( ) => {
408
- //assert
409
- test . equals ( util . sanitized ( testPattern . extendedTemplate ) , util . sanitized ( '<p><strong>Single-quoted</strong></p><p><em>Double-quoted</em></p><p><strong class="foo" id=\'bar\'>With attributes</strong></p>' ) ) ;
410
- test . end ( ) ;
411
- } ) ;
412
- } ) ;
413
- } ) ;
414
-
415
- tap . only ( 'parameter hunter expands links inside parameters' , function ( test ) {
416
- const pl = util . fakePatternLab ( testPatternsPath ) ;
417
-
418
- var commentPath = path . join ( '00-test' , 'comment.mustache' ) ;
419
- var commentPattern = loadPattern ( commentPath , pl ) ;
420
-
421
- var testPatternPath = path . join ( '00-test' , 'sticky-comment.mustache' ) ;
422
- var testPattern = loadPattern ( testPatternPath , pl ) ;
423
-
424
- //override the commentTemplate - i dont really want to create another file
425
- pl . patterns [ 0 ] . template = '<a href="{{{ url }}}">{{ description }}</a>' ;
426
- pl . patterns [ 0 ] . extendedTemplate = pl . patterns [ 0 ] . template ;
427
-
428
- //override the file
429
- testPattern . template = "{{> test-comment(url: 'link.test-comment', description: 'Link to single comment') }}" ;
430
- testPattern . extendedTemplate = testPattern . template ;
431
- testPattern . parameteredPartials [ 0 ] = testPattern . template ;
432
-
433
- var p1 = processIterative ( commentPattern , pl ) ;
434
- var p2 = processIterative ( testPattern , pl ) ;
435
-
436
- Promise . all ( [ p1 , p2 ] ) . then ( ( ) => {
437
- //act
438
- parameter_hunter . find_parameters ( testPattern , pl ) . then ( ( ) => {
439
- //assert
440
- test . equals ( util . sanitized ( testPattern . extendedTemplate ) , util . sanitized ( '<a href="/patterns/00-test-comment/00-test-comment.rendered.html">Link to single comment</a>' ) ) ;
441
- test . end ( ) ;
442
- } ) ;
443
- } ) ;
444
- } ) ;
0 commit comments