feat(app): pipeline detail tabs are a bottom bar with icons on phones, with Run and Runs above it
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/features/pipelines/screen.dart';
|
||||
import 'package:pipelines_app/features/pipelines/ui/run_pipeline_wording.dart';
|
||||
import 'package:pipelines_app/features/pipelines/widgets/pipeline_detail_tab.dart';
|
||||
|
||||
import 'fixtures.dart';
|
||||
import 'test_helpers.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('on a phone the pipeline tabs sit at the bottom with icons, '
|
||||
'Run above them', (tester) async {
|
||||
tester.view.physicalSize = const Size(390, 844);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.reset);
|
||||
final fixture = PipelineFixture();
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(home: PipelinesScreen(gateway: gatewayFor(fixture))),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.byKey(const Key('pipeline-row-1')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final tabs = tester.getRect(find.byKey(const Key('pipeline-detail-tabs')));
|
||||
expect(tabs.bottom, greaterThan(844 - 90));
|
||||
for (final tab in PipelineDetailTab.values) {
|
||||
expect(find.byIcon(tab.icon), findsOneWidget, reason: tab.name);
|
||||
}
|
||||
final run = tester.getRect(find.byKey(runPipelineActionKey));
|
||||
expect(run.bottom, lessThanOrEqualTo(tabs.top));
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user