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.
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
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));
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user