You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pin the sign contract of build_direction_chart's rows with a test #296
No test pins the sign contract of build_direction_chart. A sign error can reach the chart unnoticed.
services/email/message/charts.py:build_direction_chart negates every incoming count, so both directions can stack away from zero. abstract/static/abstract/chart_card.js's drawVariation now accumulates its running base per sign to follow that:
f"{incoming_direction}_{key}": -value
No test exercises the negation, and nothing pins the contract that incoming rows are negative and outgoing rows are positive. A Python test can hold that end of the wire without any JS harness. Assert the sign of each incoming_* key against its outgoing_* twin for the same day. Assert also that y_scale.diverging is set.
side quest: build_direction_chart's negated incoming rows are untested, so the variation chart's negative-value input contract is unpinned. [services/email/message/charts.py]
Activity