Files
pipelines/app/test/features/pipelines/pipeline_detail_bottom_tabs_test.dart
T

33 lines
1.3 KiB
Dart

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));
});
}