Introducing columns formulas
This commit is contained in:
@@ -243,7 +243,7 @@ class TestConflictResolution:
|
||||
css, formatted = engine.apply_format(rules, cell_value=150, row_data=row_data)
|
||||
|
||||
assert isinstance(css, StyleContainer)
|
||||
assert "var(--color-secondary)" in css.css # Style from Rule 2
|
||||
assert css.cls == "mf-formatting-secondary" # Style from Rule 2
|
||||
assert formatted == "150.00 €" # Formatter from Rule 1
|
||||
|
||||
# Case 2: Condition not met (value <= budget)
|
||||
@@ -282,7 +282,7 @@ class TestConflictResolution:
|
||||
|
||||
css, formatted = engine.apply_format(rules, cell_value=-5.67)
|
||||
|
||||
assert "var(--color-error)" in css.css # Rule 3 wins for style
|
||||
assert css.cls == "mf-formatting-error" # Rule 3 wins for style
|
||||
assert formatted == "-6 €" # Rule 4 wins for formatter (precision=0)
|
||||
|
||||
|
||||
@@ -316,7 +316,7 @@ class TestWithRowData:
|
||||
css, _ = engine.apply_format(rules, cell_value=42, row_data=row_data)
|
||||
|
||||
assert isinstance(css, StyleContainer)
|
||||
assert "background-color" in css.css
|
||||
assert css.cls == "mf-formatting-error"
|
||||
|
||||
|
||||
class TestPresets:
|
||||
@@ -327,7 +327,7 @@ class TestPresets:
|
||||
|
||||
css, _ = engine.apply_format(rules, cell_value=42)
|
||||
|
||||
assert "var(--color-success)" in css.css
|
||||
assert css.cls == "mf-formatting-success"
|
||||
|
||||
def test_formatter_preset(self):
|
||||
"""Formatter preset is resolved correctly."""
|
||||
|
||||
Reference in New Issue
Block a user