forked from GenieFramework/Genie.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests_views_rendering.jl
28 lines (20 loc) · 1.05 KB
/
tests_views_rendering.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
@safetestset "HTML+Julia rendering" begin
@safetestset "Simple tag rendering" begin
using Genie
using Genie.Renderer.Html
import Genie.Util: fws
copy = "Hello Genie"
@test Html.p(copy) |> fws == "<p>$copy</p>" |> fws
@test Html.div() |> fws == "<div></div>" |> fws
@test Html.br() |> fws == "<br$(Genie.config.html_parser_close_tag)>" |> fws
message = "Important message"
@test Html.span(message, class = "focus") |> fws ==
"<span class=\"focus\">$message</span>" |> fws
@test Html.span(message, class = "focus"; NamedTuple{(Symbol("data-process"),)}(("pre-process",))...) |> fws ==
"<span class=\"focus\" data-process=\"pre-process\">Important message</span>" |> fws
@test Html.span("Important message", class = "focus"; NamedTuple{(Symbol("data-process"),)}(("pre-process",))...) do
Html.a("Click here to read message")
end |> fws ==
"<span class=\"focus\" data-process=\"pre-process\" Important message><a>Click here to read message</a></span>" |> fws
end;
end;