Merge commit '2da375ccce14528305d19416678bc2667520afa9' into pipelines/run-20261111-1951-material-cleanup-chat-workspace-and-sess-8fd9
This commit is contained in:
@@ -35,7 +35,6 @@ void main() {
|
||||
onOpen: (_) {},
|
||||
now: () => attentionNow,
|
||||
notifications: notify,
|
||||
cupertino: false,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/features/attention/ui/needs_you_bell.dart';
|
||||
import 'package:pipelines_app/features/attention/ui/needs_you_keys.dart';
|
||||
|
||||
import 'needs_you_test_support.dart';
|
||||
@@ -106,32 +104,4 @@ void main() {
|
||||
expect(find.byKey(attentionSheetKey), findsNothing);
|
||||
expect(bellHasFocus(tester), isTrue);
|
||||
});
|
||||
|
||||
testWidgets('a stale cupertino flag still draws the Material bell and sheet', (
|
||||
tester,
|
||||
) async {
|
||||
await tester.pumpWidget(
|
||||
attentionApp(
|
||||
Scaffold(
|
||||
body: Center(
|
||||
child: NeedsYouBell(
|
||||
entries: [attentionFixture()],
|
||||
cupertino: true,
|
||||
onOpen: (_) {},
|
||||
onDismiss: (_) {},
|
||||
onClearAll: (_) {},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
expect(tester.widget(find.byKey(attentionBellKey)), isA<IconButton>());
|
||||
expect(find.byIcon(Icons.notifications_outlined), findsOneWidget);
|
||||
|
||||
await tester.tap(find.byKey(attentionBellKey));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byType(BottomSheet), findsOneWidget);
|
||||
expect(find.byKey(attentionSheetKey), findsOneWidget);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/features/attention/domain/attention_models.dart';
|
||||
import 'package:pipelines_app/features/attention/ui/needs_you_keys.dart';
|
||||
@@ -7,6 +7,29 @@ import 'package:pipelines_app/ui/status/run_status_icon.dart';
|
||||
import 'needs_you_test_support.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('Needs you uses a dialog wide and a bottom sheet narrow', (
|
||||
tester,
|
||||
) async {
|
||||
final entry = attentionFixture(id: 1, title: 'Ship the release');
|
||||
tester.view.physicalSize = const Size(800, 1400);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.resetPhysicalSize);
|
||||
addTearDown(tester.view.resetDevicePixelRatio);
|
||||
await tester.pumpWidget(attentionApp(NeedsYouPage(entries: [entry])));
|
||||
|
||||
await tester.tap(find.byKey(attentionBellKey));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byType(Dialog), findsOneWidget);
|
||||
Navigator.of(tester.element(find.byKey(attentionSheetKey))).pop();
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
tester.view.physicalSize = const Size(500, 1400);
|
||||
await tester.pump();
|
||||
await tester.tap(find.byKey(attentionBellKey));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byType(BottomSheet), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('Material sheet names every row and every dismiss action', (
|
||||
tester,
|
||||
) async {
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -155,6 +155,45 @@ void main() {
|
||||
});
|
||||
});
|
||||
|
||||
testWidgets('colour uses a dialog wide and a bottom sheet narrow', (
|
||||
tester,
|
||||
) async {
|
||||
final gateway = _gateway();
|
||||
tester.view.physicalSize = const Size(800, 1400);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.resetPhysicalSize);
|
||||
addTearDown(tester.view.resetDevicePixelRatio);
|
||||
await _pump(tester, gateway, brightness: Brightness.light);
|
||||
|
||||
await tester.tap(
|
||||
find.descendant(
|
||||
of: find.byKey(const Key('chat-actions-s2')),
|
||||
matching: find.byType(IconButton),
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.text('Colour…'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byType(Dialog), findsOneWidget);
|
||||
Navigator.of(
|
||||
tester.element(find.byKey(const Key('chat-color-sheet'))),
|
||||
).pop();
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
tester.view.physicalSize = const Size(500, 1400);
|
||||
await tester.pump();
|
||||
await tester.tap(
|
||||
find.descendant(
|
||||
of: find.byKey(const Key('chat-actions-s2')),
|
||||
matching: find.byType(IconButton),
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.text('Colour…'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byType(BottomSheet), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('the selected coloured row keeps its colour and selection', (
|
||||
tester,
|
||||
) async {
|
||||
|
||||
@@ -96,6 +96,23 @@ void main() {
|
||||
expect(find.textContaining('Last 7 days'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('filter uses a dialog wide and a bottom sheet narrow', (
|
||||
tester,
|
||||
) async {
|
||||
await mount(tester);
|
||||
await tester.tap(find.byKey(const ValueKey('runs.filter')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byType(Dialog), findsOneWidget);
|
||||
await tester.tap(find.byKey(runsFilterDoneKey));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
tester.view.physicalSize = const Size(500, 1400);
|
||||
await tester.pump();
|
||||
await tester.tap(find.byKey(const ValueKey('runs.filter')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byType(BottomSheet), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('Material single-choice groups are check rows, not checkboxes', (
|
||||
tester,
|
||||
) async {
|
||||
@@ -136,10 +153,7 @@ void main() {
|
||||
testWidgets('the usage page is honest when nothing was reported', (
|
||||
tester,
|
||||
) async {
|
||||
await mount(
|
||||
tester,
|
||||
createdAt: DateTime(2020, 1, 1).toIso8601String(),
|
||||
);
|
||||
await mount(tester, createdAt: DateTime(2020, 1, 1).toIso8601String());
|
||||
await tester.tap(find.byKey(const ValueKey('runs.stats')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user