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