Skip to content

Commit f064a4f

Browse files
committed
fix tests
1 parent eb4f9c2 commit f064a4f

File tree

1 file changed

+53
-53
lines changed

1 file changed

+53
-53
lines changed

test/resources.jl

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ using Dash: Resource, ResourcePkg, ResourcesRegistry,
3030
relative_package_path = "test.js",
3131
async = :lazy
3232
)
33-
33+
3434
@test test_resource.async == :lazy
3535
@test isdynamic(test_resource, true)
3636
@test isdynamic(test_resource, false)
@@ -39,7 +39,7 @@ using Dash: Resource, ResourcePkg, ResourcesRegistry,
3939
relative_package_path = "test.js",
4040
async = :eager
4141
)
42-
42+
4343
@test test_resource.async == :eager
4444
@test !isdynamic(test_resource, true)
4545
@test isdynamic(test_resource, false)
@@ -77,26 +77,26 @@ end
7777
Resource(
7878
relative_package_path = "dash-renderer/dash_renderer.min.js",
7979
dev_package_path = "dash-renderer/dash_renderer.dev.js",
80-
external_url = "https://dash_renderer.min.js"
80+
external_url = "https://dash_renderer.min.js"
8181
)
8282
]
83-
)
83+
)
8484
)
8585

8686
test_app = dash(include_assets_files = false)
8787

8888
app_resources = ApplicationResources(test_app, test_registry)
8989
@test length(app_resources.css) == 0
9090
@test length(app_resources.js) == 3
91-
@test app_resources.js[1] isa AppRelativeResource
91+
@test app_resources.js[1] isa AppRelativeResource
9292
@test app_resources.js[1].namespace == "dash_renderer"
9393
@test app_resources.js[1].relative_path == "path1.prod.js"
9494

95-
@test app_resources.js[2] isa AppRelativeResource
95+
@test app_resources.js[2] isa AppRelativeResource
9696
@test app_resources.js[2].namespace == "dash_renderer"
9797
@test app_resources.js[2].relative_path == "path2.prod.js"
9898

99-
@test app_resources.js[end] isa AppRelativeResource
99+
@test app_resources.js[end] isa AppRelativeResource
100100
@test app_resources.js[end].namespace == "dash_renderer"
101101
@test app_resources.js[end].relative_path == "dash-renderer/dash_renderer.min.js"
102102

@@ -113,15 +113,15 @@ end
113113
@test length(app_resources.css) == 0
114114
@test length(app_resources.js) == 3
115115

116-
@test app_resources.js[1] isa AppRelativeResource
116+
@test app_resources.js[1] isa AppRelativeResource
117117
@test app_resources.js[1].namespace == "dash_renderer"
118118
@test app_resources.js[1].relative_path == "path1.prod.js"
119-
120-
@test app_resources.js[2] isa AppRelativeResource
119+
120+
@test app_resources.js[2] isa AppRelativeResource
121121
@test app_resources.js[2].namespace == "dash_renderer"
122122
@test app_resources.js[2].relative_path == "path2.prod.js"
123-
124-
@test app_resources.js[end] isa AppRelativeResource
123+
124+
@test app_resources.js[end] isa AppRelativeResource
125125
@test app_resources.js[end].namespace == "dash_renderer"
126126
@test app_resources.js[end].relative_path == "dash-renderer/dash_renderer.dev.js"
127127

@@ -130,23 +130,23 @@ end
130130
@test "path1.prod.js" in app_resources.files["dash_renderer"].files
131131
@test "path2.prod.js" in app_resources.files["dash_renderer"].files
132132
@test "dash-renderer/dash_renderer.dev.js" in app_resources.files["dash_renderer"].files
133-
133+
134134
test_app = dash(include_assets_files = false)
135135
enable_dev_tools!(test_app, debug = false, dev_tools_props_check = true, dev_tools_serve_dev_bundles = true)
136136

137137
app_resources = ApplicationResources(test_app, test_registry)
138138
@test length(app_resources.css) == 0
139139
@test length(app_resources.js) == 3
140140

141-
@test app_resources.js[1] isa AppRelativeResource
141+
@test app_resources.js[1] isa AppRelativeResource
142142
@test app_resources.js[1].namespace == "dash_renderer"
143143
@test app_resources.js[1].relative_path == "path1.dev.js"
144-
145-
@test app_resources.js[2] isa AppRelativeResource
144+
145+
@test app_resources.js[2] isa AppRelativeResource
146146
@test app_resources.js[2].namespace == "dash_renderer"
147147
@test app_resources.js[2].relative_path == "path2.dev.js"
148-
149-
@test app_resources.js[end] isa AppRelativeResource
148+
149+
@test app_resources.js[end] isa AppRelativeResource
150150
@test app_resources.js[end].namespace == "dash_renderer"
151151
@test app_resources.js[end].relative_path == "dash-renderer/dash_renderer.dev.js"
152152

@@ -162,13 +162,13 @@ end
162162
@test length(app_resources.css) == 0
163163
@test length(app_resources.js) == 3
164164

165-
@test app_resources.js[1] isa AppExternalResource
165+
@test app_resources.js[1] isa AppExternalResource
166166
@test app_resources.js[1].url == "external_path1.prod.js"
167-
167+
168168
@test app_resources.js[2] isa AppExternalResource
169169
@test app_resources.js[2].url == "external_path2.prod.js"
170-
171-
@test app_resources.js[end] isa AppExternalResource
170+
171+
@test app_resources.js[end] isa AppExternalResource
172172
@test app_resources.js[end].url == "https://dash_renderer.min.js"
173173

174174
@test isempty(app_resources.files)
@@ -204,7 +204,7 @@ end
204204
[
205205
Resource(
206206
relative_package_path = "dash-renderer/dash_renderer.min.js",
207-
external_url = "https://dash_renderer.min.js"
207+
external_url = "https://dash_renderer.min.js"
208208
),
209209
Resource(
210210
relative_package_path = "dash-renderer/dash_renderer.dyn.js",
@@ -216,9 +216,9 @@ end
216216
external_url = "https://dash_renderer.eag.js",
217217
async = :eager
218218
)
219-
219+
220220
]
221-
)
221+
)
222222
)
223223

224224
test_app = dash(include_assets_files = false)
@@ -227,14 +227,14 @@ end
227227
@test length(app_resources.css) == 0
228228
@test length(app_resources.js) == 2
229229
@test app_resources.js[2].relative_path == "dash-renderer/dash_renderer.min.js"
230-
230+
231231
@test haskey(app_resources.files, "dash_renderer")
232232
@test app_resources.files["dash_renderer"].base_path == "path"
233233
@test "path1.prod.js" in app_resources.files["dash_renderer"].files
234234
@test "dash-renderer/dash_renderer.min.js" in app_resources.files["dash_renderer"].files
235235
@test "dash-renderer/dash_renderer.dyn.js" in app_resources.files["dash_renderer"].files
236236
@test "dash-renderer/dash_renderer.eag.js" in app_resources.files["dash_renderer"].files
237-
237+
238238
test_app = dash(eager_loading = true, include_assets_files = false)
239239

240240
app_resources = ApplicationResources(test_app, test_registry)
@@ -274,13 +274,13 @@ end
274274
[
275275
Resource(
276276
relative_package_path = "dash-renderer/dash_renderer.min.js",
277-
external_url = "https://dash_renderer.min.js"
277+
external_url = "https://dash_renderer.min.js"
278278
),
279279
]
280-
)
280+
)
281281
)
282282

283-
register_package!(test_registry,
283+
register_package!(test_registry,
284284
ResourcePkg(
285285
"comps",
286286
"comps_path",
@@ -298,7 +298,7 @@ end
298298
)
299299
]
300300
)
301-
)
301+
)
302302

303303
test_app = dash(include_assets_files = false)
304304

@@ -348,10 +348,10 @@ end
348348
[
349349
Resource(
350350
relative_package_path = "dash-renderer/dash_renderer.min.js",
351-
external_url = "https://dash_renderer.min.js"
351+
external_url = "https://dash_renderer.min.js"
352352
),
353353
]
354-
)
354+
)
355355
)
356356

357357
external_css = ["test.css", Dict("rel"=>"stylesheet", "href"=>"test.css")]
@@ -366,19 +366,19 @@ end
366366
@test app_resources.js[end].relative_path == "dash-renderer/dash_renderer.min.js"
367367

368368
@test app_resources.css[1] isa AppExternalResource
369-
@test app_resources.css[1].url == "test.css"
369+
@test app_resources.css[1].url == "test.css"
370370

371371
@test app_resources.css[2] isa AppCustomResource
372-
@test app_resources.css[2].params["href"] == "test.css"
373-
@test app_resources.css[2].params["rel"] == "stylesheet"
372+
@test app_resources.css[2].params["href"] == "test.css"
373+
@test app_resources.css[2].params["rel"] == "stylesheet"
374374

375375
@test app_resources.js[2] isa AppExternalResource
376-
@test app_resources.js[2].url == "test.js"
377-
376+
@test app_resources.js[2].url == "test.js"
377+
378378
@test app_resources.js[3] isa AppCustomResource
379-
@test app_resources.js[3].params["src"] == "test.js"
380-
@test app_resources.js[3].params["crossorigin"] == "anonymous"
381-
379+
@test app_resources.js[3].params["src"] == "test.js"
380+
@test app_resources.js[3].params["crossorigin"] == "anonymous"
381+
382382
end
383383
@testset "application resources assets" begin
384384
test_registry = ResourcesRegistry(
@@ -401,15 +401,15 @@ end
401401
"path",
402402
[
403403
]
404-
)
404+
)
405405
)
406406

407407
test_app = dash(assets_folder = "assets_include")
408408

409409
app_resources = ApplicationResources(test_app, test_registry)
410410
@test length(app_resources.css) == 1
411411
@test length(app_resources.js) == 4
412-
@test app_resources.favicon == "favicon.ico"
412+
@test app_resources.favicon.path == "favicon.ico"
413413
@test all(app_resources.css) do r
414414
r isa AppAssetResource
415415
end
@@ -444,16 +444,16 @@ end
444444
app_resources = ApplicationResources(test_app, test_registry)
445445
@test length(app_resources.css) == 1
446446
@test length(app_resources.js) == 4
447-
@test app_resources.favicon == "favicon.ico"
447+
@test app_resources.favicon.path == "favicon.ico"
448448
@test all(app_resources.css) do r
449449
r isa AppAssetResource
450450
end
451451
@test app_resources.css[1].path == "test.css"
452-
452+
453453
@test all(app_resources.js) do r
454454
r isa AppAssetResource
455455
end
456-
456+
457457
@test any(app_resources.js) do r
458458
r.path == "test1.js"
459459
end
@@ -472,18 +472,18 @@ end
472472
app_resources = ApplicationResources(test_app, test_registry)
473473
@test length(app_resources.css) == 1
474474
@test length(app_resources.js) == 4
475-
@test app_resources.favicon == "favicon.ico"
475+
@test app_resources.favicon.path == "favicon.ico"
476476

477477
@test all(app_resources.css) do r
478478
r isa AppExternalResource
479479
end
480480

481481
@test app_resources.css[1].url == "http://ext/test.css"
482-
482+
483483
@test all(app_resources.js) do r
484484
r isa AppExternalResource
485485
end
486-
486+
487487
@test any(app_resources.js) do r
488488
r.url == "http://ext/test1.js"
489489
end
@@ -496,22 +496,22 @@ end
496496
@test any(app_resources.js) do r
497497
r.url == "http://ext/sub/sub2.js"
498498
end
499-
499+
500500
test_app = dash(assets_folder = "assets_include", assets_ignore = ".*1")
501501

502502
app_resources = ApplicationResources(test_app, test_registry)
503503
@test length(app_resources.css) == 1
504504
@test length(app_resources.js) == 2
505-
@test app_resources.favicon == "favicon.ico"
505+
@test app_resources.favicon.path == "favicon.ico"
506506
@test all(app_resources.css) do r
507507
r isa AppAssetResource
508508
end
509509
@test app_resources.css[1].path == "test.css"
510-
510+
511511
@test all(app_resources.js) do r
512512
r isa AppAssetResource
513513
end
514-
514+
515515
@test !any(app_resources.js) do r
516516
r.path == "test1.js"
517517
end

0 commit comments

Comments
 (0)