Skip to content

Commit 09129a5

Browse files
committed
test: update theming index sass test to test density and use correct API
Also ensures these tests run with `--only_build_tests`, ensuring they run in the MDC snapshot test job.
1 parent 53933e0 commit 09129a5

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

src/material/core/theming/tests/BUILD.bazel

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
load("//tools:defaults.bzl", "jasmine_node_test", "sass_binary", "ts_library")
2+
load("@bazel_skylib//rules:build_test.bzl", "build_test")
23

34
package(default_visibility = ["//visibility:public"])
45

@@ -44,6 +45,16 @@ sass_binary(
4445
deps = ["//src/material:sass_lib"],
4546
)
4647

48+
build_test(
49+
name = "sass_compile_tetss",
50+
targets = [
51+
":test-css-variables-theme",
52+
":test-theming-api",
53+
":test-theming-bundle",
54+
":test-legacy-theming-bundle",
55+
],
56+
)
57+
4758
ts_library(
4859
name = "unit_test_lib",
4960
testonly = True,

src/material/core/theming/tests/test-theming-bundle.scss

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ mat.$theme-ignore-duplication-warnings: true;
1111

1212
$theme: mat.define-light-theme((
1313
color: (
14-
primary: mat.$red-palette,
15-
accent: mat.$blue-palette,
14+
primary: mat.define-palette(mat.$red-palette),
15+
accent: mat.define-palette(mat.$blue-palette),
1616
),
1717
density: -2,
1818
));
@@ -22,10 +22,23 @@ $theme: mat.define-light-theme((
2222
@include mat.all-component-themes($theme);
2323
@include mat.all-component-typographies();
2424
@include mat.all-component-colors($theme);
25-
@include mat.all-legacy-component-themes($theme);
26-
@include mat.all-legacy-component-typographies();
27-
@include mat.all-legacy-component-colors($theme);
25+
26+
@include mat.private-all-component-densities($theme);
27+
@include mat.private-all-component-densities((density: 0));
28+
@include mat.private-all-component-densities((density: -1));
29+
@include mat.private-all-component-densities((density: minimum));
30+
2831
@include mat.core-theme($theme);
2932
@include mat.button-theme($theme);
33+
3034
@include mat.strong-focus-indicators();
3135
@include mat.strong-focus-indicators-theme($theme);
36+
37+
// Legacy.
38+
@include mat.all-legacy-component-themes($theme);
39+
@include mat.all-legacy-component-typographies();
40+
@include mat.all-legacy-component-colors($theme);
41+
@include mat.private-all-legacy-component-densities($theme);
42+
@include mat.private-all-legacy-component-densities((density: 0));
43+
@include mat.private-all-legacy-component-densities((density: -1));
44+
@include mat.private-all-legacy-component-densities((density: minimum));

0 commit comments

Comments
 (0)