ecb for dashboard - WRONG NEEDS CORRECTION ASAP
This commit is contained in:
@@ -70,6 +70,8 @@ mod tests {
|
||||
next_import_at: "2026-08-13T15:00:00Z".to_string(),
|
||||
batches: vec![batch(9, "succeeded")],
|
||||
covered_currencies: vec!["CZK".to_string(), "USD".to_string()],
|
||||
transactions_postable_through: Some("2026-08-13".to_string()),
|
||||
statements_postable_through: Some("2026-08-12".to_string()),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,6 +133,20 @@ mod tests {
|
||||
assert!(html.contains("2 failed"), "{html}");
|
||||
}
|
||||
|
||||
/// Coverage is a publication date; the reader's question is which dates
|
||||
/// they may post. The card has to answer the second one outright, and the
|
||||
/// two bounds differ because the two rules differ.
|
||||
#[test]
|
||||
fn the_card_says_which_dates_can_be_posted() {
|
||||
let html = render_page(&healthy_page());
|
||||
|
||||
assert!(html.contains("What can be posted right now"), "{html}");
|
||||
assert!(html.contains("Ordinary transactions"));
|
||||
assert!(html.contains("<strong>2026-08-13</strong>"), "{html}");
|
||||
assert!(html.contains("Statements & decisive dates"));
|
||||
assert!(html.contains("<strong>2026-08-12</strong>"), "{html}");
|
||||
}
|
||||
|
||||
/// A pipeline that has never succeeded is a different problem from one
|
||||
/// that has fallen behind, and reads differently.
|
||||
#[test]
|
||||
@@ -140,12 +156,16 @@ mod tests {
|
||||
page.verified_through_date = None;
|
||||
page.covered_currencies.clear();
|
||||
page.batches.clear();
|
||||
page.transactions_postable_through = None;
|
||||
page.statements_postable_through = None;
|
||||
|
||||
let html = render_page(&page);
|
||||
|
||||
assert!(!html.contains("Template error"), "{html}");
|
||||
assert!(html.contains("No rates have ever been imported"));
|
||||
assert!(html.contains("every conversion in a foreign currency is refused"));
|
||||
// And the postable block says so too rather than showing an empty date.
|
||||
assert!(html.contains("<strong>Nothing.</strong>"), "{html}");
|
||||
}
|
||||
|
||||
/// While a batch runs the card watches itself, and the fragment it swaps
|
||||
|
||||
Reference in New Issue
Block a user