Skip to content

Commit

Permalink
test: Add regression test for #256: template attributes are lowercased
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarmil committed May 15, 2022
1 parent e24dd88 commit 0365eb1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/Unit.Client/Templating.fs
Expand Up @@ -173,6 +173,10 @@ type BindTester() =

type ``Regression #11`` = Template<"""<span class="${Hole}">${Hole}</span>""">

type ``Regression #256`` = Template<"""<svg width="200" height="200" version="1.1" viewBox="0 0 100 100" class="regression-256" xmlns="http://www.w3.org/2000/svg">
<circle cx="50" cy="50" r="45" fill="${CircleFill}" stroke="${CircleStroke}" stroke-width="3"/>
</svg>""">

let Tests() =
div {
attr.id "test-fixture-templating"
Expand Down Expand Up @@ -200,6 +204,10 @@ let Tests() =
``Regression #11``()
.Hole("regression-11")
.Elt()
``Regression #256``()
.CircleFill("red")
.CircleStroke("black")
.Elt()
comp<EventTester>
comp<BindTester>
}
5 changes: 5 additions & 0 deletions tests/Unit/Tests/Templating.fs
Expand Up @@ -233,3 +233,8 @@ module Templating =
[<Test>]
let ``Regression #11: common hole in attrs and children``() =
test <@ elt.ByClass("regression-11").Text = "regression-11" @>

[<Test>]
let ``Regression #256: attribute name case is respected``() =
test <@ elt.ByClass("regression-256").GetDomAttribute("viewbox") |> isNull @>
test <@ elt.ByClass("regression-256").GetDomAttribute("viewBox") = "0 0 100 100" @>

0 comments on commit 0365eb1

Please sign in to comment.