diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-12-21 09:17:51 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-12-21 11:21:07 +0100 |
commit | effa6a4226214b10c1667aa79ed7e9d39656f11a (patch) | |
tree | b4725cc5941491540963f7a80b6d0820a2f8e594 /resources | |
parent | 5d5f0a2371a38da2e328cb705f54c1952a736164 (diff) |
tocss: Add some more test cases
See #10555
Diffstat (limited to 'resources')
-rw-r--r-- | resources/resource_transformers/tocss/dartsass/integration_test.go | 6 | ||||
-rw-r--r-- | resources/resource_transformers/tocss/scss/integration_test.go | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/resources/resource_transformers/tocss/dartsass/integration_test.go b/resources/resource_transformers/tocss/dartsass/integration_test.go index 083cef14f..3d7c07ba6 100644 --- a/resources/resource_transformers/tocss/dartsass/integration_test.go +++ b/resources/resource_transformers/tocss/dartsass/integration_test.go @@ -290,6 +290,7 @@ func TestOptionVars(t *testing.T) { body { body { background: url(vars.$image) no-repeat center/cover; + font-family: vars.$font; } } @@ -303,7 +304,8 @@ b { } -- layouts/index.html -- {{ $image := "images/hero.jpg" }} -{{ $vars := dict "$color1" "blue" "$color2" "green" "font_size" "24px" "image" $image }} +{{ $font := "Hugo's New Roman" }} +{{ $vars := dict "$color1" "blue" "$color2" "green" "font_size" "24px" "image" $image "font" $font }} {{ $cssOpts := (dict "transpiler" "dartsass" "outputStyle" "compressed" "vars" $vars ) }} {{ $r := resources.Get "scss/main.scss" | toCSS $cssOpts }} T1: {{ $r.Content }} @@ -316,7 +318,7 @@ T1: {{ $r.Content }} NeedsOsFS: true, }).Build() - b.AssertFileContent("public/index.html", `T1: body body{background:url(images/hero.jpg) no-repeat center/cover}p{color:blue;font-size:24px}b{color:green}`) + b.AssertFileContent("public/index.html", `T1: body body{background:url(images/hero.jpg) no-repeat center/cover;font-family:Hugo's New Roman}p{color:blue;font-size:24px}b{color:green}`) } func TestOptionVarsParams(t *testing.T) { diff --git a/resources/resource_transformers/tocss/scss/integration_test.go b/resources/resource_transformers/tocss/scss/integration_test.go index 799c70ee5..d0dd65e20 100644 --- a/resources/resource_transformers/tocss/scss/integration_test.go +++ b/resources/resource_transformers/tocss/scss/integration_test.go @@ -263,6 +263,7 @@ func TestOptionVars(t *testing.T) { body { body { background: url($image) no-repeat center/cover; + font-family: $font; } } @@ -276,7 +277,8 @@ b { } -- layouts/index.html -- {{ $image := "images/hero.jpg" }} -{{ $vars := dict "$color1" "blue" "$color2" "green" "font_size" "24px" "image" $image }} +{{ $font := "Hugo's New Roman" }} +{{ $vars := dict "$color1" "blue" "$color2" "green" "font_size" "24px" "image" $image "font" $font }} {{ $cssOpts := (dict "transpiler" "libsass" "outputStyle" "compressed" "vars" $vars ) }} {{ $r := resources.Get "scss/main.scss" | toCSS $cssOpts }} T1: {{ $r.Content }} @@ -289,5 +291,5 @@ T1: {{ $r.Content }} NeedsOsFS: true, }).Build() - b.AssertFileContent("public/index.html", `T1: body body{background:url(images/hero.jpg) no-repeat center/cover}p{color:blue;font-size:var 24px}b{color:green}`) + b.AssertFileContent("public/index.html", `T1: body body{background:url(images/hero.jpg) no-repeat center/cover;font-family:Hugo's New Roman}p{color:blue;font-size:var 24px}b{color:green}`) } |