Skip to content

Commit 3990c2c

Browse files
committed
chore: Added automated test
1 parent 4550bef commit 3990c2c

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

apps/automated/src/ui/styling/style-tests.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1948,6 +1948,36 @@ export function test_undefined_css_variable_invalidates_entire_expression() {
19481948
TKUnit.assertEqual(label.style.boxShadow, undefined, 'the css variable is undefined');
19491949
}
19501950

1951+
export function test_css_variable_with_another_css_variable_as_value() {
1952+
const page = helper.getClearCurrentPage();
1953+
const redColor = '#FF0000';
1954+
const cssVarName = `--my-background-color-${Date.now()}`;
1955+
const cssShadowVarName = `--my-shadow-color-${Date.now()}`;
1956+
1957+
const stack = new StackLayout();
1958+
stack.css = `
1959+
StackLayout {
1960+
${cssVarName}: ${redColor};
1961+
}
1962+
1963+
Label {
1964+
${cssShadowVarName}: var(${cssVarName});
1965+
}
1966+
1967+
Label.lab1 {
1968+
box-shadow: 10 10 5 12 var(${cssShadowVarName});
1969+
color: black;
1970+
}`;
1971+
1972+
const label = new Label();
1973+
page.content = stack;
1974+
stack.addChild(label);
1975+
1976+
label.className = 'lab1';
1977+
1978+
TKUnit.assertEqual(label.style.boxShadow?.color?.hex, redColor, 'Failed to resolve css expression variable');
1979+
}
1980+
19511981
export function test_css_variable_that_resolves_to_another_css_variable_order_desc() {
19521982
const page = helper.getClearCurrentPage();
19531983

0 commit comments

Comments
 (0)