File tree Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -1559,7 +1559,7 @@ component output="true" {
1559
1559
" method" : " GET" ,
1560
1560
" children" : variables ._children .count () ? variables ._children : [],
1561
1561
" scripts" : variables ._scripts .count () ? variables ._scripts .keyArray () : [],
1562
- " assets" : [],
1562
+ " assets" : variables . _assets . count () ? variables . _assets . keyArray () : [],
1563
1563
" isolate" : variables ._isolate ,
1564
1564
" lazyLoaded" : false ,
1565
1565
" lazyIsolated" : true ,
Original file line number Diff line number Diff line change @@ -329,6 +329,20 @@ component extends="coldbox.system.testing.BaseTestCase" {
329
329
expect ( result ).notToInclude ( " tailwind.min.css" );
330
330
} );
331
331
332
+ it ( " should track assets in snapshot memo" , function () {
333
+ var result = CBWIREController .wire ( " test.should_track_assets_in_snapshot_memo" );
334
+ var parsing = parseRendering ( result );
335
+ expect ( parsing .snapshot .memo .assets ).toBeArray ();
336
+ expect ( parsing .snapshot .memo .assets .len () ).toBe ( 1 );
337
+ } );
338
+
339
+ it ( " should not track assets in snapshot memo when lazy loaded" , function () {
340
+ var result = CBWIREController .wire ( name = " test.should_track_assets_in_snapshot_memo" , lazy = true );
341
+ var parsing = parseRendering ( result );
342
+ expect ( parsing .snapshot .memo .assets ).toBeArray ();
343
+ expect ( parsing .snapshot .memo .assets .len () ).toBe ( 0 );
344
+ } );
345
+
332
346
it ( " should track scripts in snapshot memo" , function () {
333
347
var result = CBWIREController .wire ( " test.should_track_scripts_in_snapshot_memo" );
334
348
var parsing = parseRendering ( result );
Original file line number Diff line number Diff line change
1
+ <cfoutput >
2
+ <div >
3
+ <h1 >Should track assets in snapshot memo</h1 >
4
+ </div >
5
+ </cfoutput >
6
+
7
+ <cfscript >
8
+ // @startWire
9
+ function placeholder () {
10
+ return " <div>This is a placeholder</div>" ;
11
+ }
12
+ // @endWire
13
+ </cfscript >
14
+
15
+ <cbwire:assets >
16
+ <
link href =
" https://cdn.jsdelivr.net/npm/[email protected] /dist/css/bootstrap.min.css" rel =
" stylesheet" integrity =
" sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin =
" anonymous" >
17
+ </cbwire:assets >
You can’t perform that action at this time.
0 commit comments