Follow settings topic navigation in template wiring tests
This commit is contained in:
@@ -18,6 +18,7 @@ import '../features/templates/ui/template_gallery_test_support.dart'
|
||||
show GalleryGateway, galleryTemplates, pumpGallery, templatesReply;
|
||||
import 'pipelines_app_test.dart' show webServer;
|
||||
import 'pipelines_replies.dart';
|
||||
import '../features/settings/settings_topic_test_helper.dart';
|
||||
import 'package:pipelines_app/ui/adaptive/segmented_bar.dart';
|
||||
|
||||
List<Map<String, dynamic>> requestsOf(FakeChannel channel, String type) =>
|
||||
@@ -103,15 +104,9 @@ Future<void> openSettings(
|
||||
'build': {'version': 'probe'},
|
||||
'time': 'fixture',
|
||||
});
|
||||
// It then loads the server's ntfy notification settings.
|
||||
await reply(tester, channel, 'notification_settings', 1, {
|
||||
'type': 'notification_settings',
|
||||
'notification_settings': {
|
||||
'run_finished': true,
|
||||
'chat_needs_you': true,
|
||||
'chat_reply_finished': false,
|
||||
},
|
||||
});
|
||||
// Hidden notification settings do not load during this navigation flow.
|
||||
expect(requestsOf(channel, 'notification_settings'), isEmpty);
|
||||
await selectSettingsTopic(tester, 'Connection');
|
||||
}
|
||||
|
||||
Future<void> openTemplates(
|
||||
@@ -120,6 +115,7 @@ Future<void> openTemplates(
|
||||
PlatformRouteInformationProvider provider, {
|
||||
int listRead = 1,
|
||||
}) async {
|
||||
await selectSettingsTopic(tester, 'Tools');
|
||||
await tester.ensureVisible(find.byKey(SettingsKeys.templates));
|
||||
await tester.tap(find.byKey(SettingsKeys.templates));
|
||||
await tester.pump();
|
||||
@@ -241,6 +237,8 @@ void main() {
|
||||
|
||||
expect(provider.value.uri.path, '/settings');
|
||||
expect(find.byType(TemplatesScreen), findsNothing);
|
||||
expect(find.byKey(SettingsKeys.templates), findsOneWidget);
|
||||
await selectSettingsTopic(tester, 'Connection');
|
||||
expect(find.text('edited url'), findsOneWidget);
|
||||
expect(find.text('Server URL'), findsOneWidget);
|
||||
expect(sockets, 1);
|
||||
@@ -255,6 +253,8 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
expect(provider.value.uri.path, '/settings');
|
||||
expect(find.byType(TemplatesScreen), findsNothing);
|
||||
expect(find.byKey(SettingsKeys.templates), findsOneWidget);
|
||||
await selectSettingsTopic(tester, 'Connection');
|
||||
expect(find.text('edited url'), findsOneWidget);
|
||||
expect(requestsOf(channel, 'list_templates'), hasLength(2));
|
||||
expect(sockets, 1);
|
||||
|
||||
Reference in New Issue
Block a user