Merge commit '66cb9edee1367da311589ecfacc3ac312dc1a395' into pipelines/run-20261111-1951-material-cleanup-shared-ui-primitives-65fb
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/features/artifacts/ui/artifact_viewer_body.dart';
|
||||
import 'package:pipelines_app/features/changes/widgets/diff_form_control.dart';
|
||||
|
||||
void main() {
|
||||
for (final width in [400.0, 1000.0]) {
|
||||
testWidgets('diff choices adapt to app width $width', (tester) async {
|
||||
tester.view.physicalSize = Size(width, 900);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.reset);
|
||||
DiffForm? selected;
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Scaffold(
|
||||
body: Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Builder(
|
||||
builder: (context) => diffFormMenu(
|
||||
context,
|
||||
form: DiffForm.rendered,
|
||||
onChanged: (value) => selected = value,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
await tester.tap(find.byTooltip('Diff form'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(
|
||||
find.byType(BottomSheet),
|
||||
width < 600 ? findsOneWidget : findsNothing,
|
||||
);
|
||||
expect(
|
||||
find.byKey(const ValueKey('app-choice-menu')),
|
||||
width >= 600 ? findsOneWidget : findsNothing,
|
||||
);
|
||||
await tester.tap(find.text('Raw patch'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(selected, DiffForm.raw);
|
||||
expect(find.text('Raw patch'), findsNothing);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
testWidgets('artifact details adapt to app width $width', (tester) async {
|
||||
tester.view.physicalSize = Size(width, 900);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.reset);
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: Scaffold(
|
||||
body: ArtifactViewerInfoAction(
|
||||
facts: Text('Recorded artifact facts'),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
await tester.tap(find.byTooltip('Details'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Recorded artifact facts'), findsOneWidget);
|
||||
expect(find.byType(Dialog), width >= 600 ? findsOneWidget : findsNothing);
|
||||
expect(
|
||||
find.byType(BottomSheet),
|
||||
width < 600 ? findsOneWidget : findsNothing,
|
||||
);
|
||||
final context = tester.element(find.text('Recorded artifact facts'));
|
||||
Navigator.of(context).pop();
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Recorded artifact facts'), findsNothing);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
@@ -38,7 +37,6 @@ Widget _header({
|
||||
label: 'Files',
|
||||
onPressed: () {},
|
||||
materialIcon: Icons.folder_outlined,
|
||||
cupertinoIcon: CupertinoIcons.folder,
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/features/chat/conversation/chat_bar_control_style.dart';
|
||||
@@ -56,7 +55,6 @@ void main() {
|
||||
label: 'More action',
|
||||
onPressed: () {},
|
||||
materialIcon: Icons.more_horiz,
|
||||
cupertinoIcon: CupertinoIcons.ellipsis,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -206,14 +204,12 @@ void main() {
|
||||
label: 'Sidebar action',
|
||||
onPressed: () => sidebar++,
|
||||
materialIcon: Icons.menu,
|
||||
cupertinoIcon: CupertinoIcons.sidebar_left,
|
||||
),
|
||||
paneControls: [
|
||||
ChatBarAction(
|
||||
label: 'Pane action',
|
||||
onPressed: () => pane++,
|
||||
materialIcon: Icons.add_box,
|
||||
cupertinoIcon: CupertinoIcons.plus_square,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -15,7 +15,6 @@ void main() {
|
||||
child: SizedBox.expand(
|
||||
child: ChatWorkspaceEntrance(
|
||||
visible: visible,
|
||||
cupertino: false,
|
||||
child: Material(child: child),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user