Files
pipelines/app/test/features/runs/domain/run_tab_counts_test.dart
T
alan efca56e4e4 Show running and failed run counts independently
Give the Runs tab separate activity and failure indicators so neither suppresses the other. Reuse known summaries and pushed updates, keep failed states separate from decisions and dismissal counts, and update across tabs even when total attention is unchanged.
2026-11-11 22:10:37 +00:00

42 lines
1.2 KiB
Dart

import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/features/runs/domain/run_tab_counts.dart';
void main() {
test('running and failed statuses are counted independently', () {
expect(
runTabCounts([
{'status': 'running', 'executing': true},
{'status': 'queued', 'executing': true},
{'status': 'failed', 'executing': false},
{'status': 'waiting', 'executing': false},
{'status': 'canceled'},
{'status': 'interrupted'},
]),
(running: 2, failed: 1),
);
});
test('terminal statuses override stale execution flags', () {
expect(
runTabCounts([
{'status': 'failed', 'executing': true},
{'status': 'succeeded', 'executing': true},
]),
(running: 0, failed: 1),
);
});
test('older running summaries work without inventing other live states', () {
expect(
runTabCounts([
{'status': 'running'},
{'status': 'running', 'executing': false},
{'status': 'queued'},
{'status': 'waiting'},
]),
(running: 1, failed: 0),
);
expect(runTabCounts([]), (running: 0, failed: 0));
});
}