Organize settings into retained topic tabs
This commit is contained in:
@@ -10,6 +10,7 @@ import 'package:pipelines_app/features/settings/settings_screen.dart';
|
||||
import 'package:pipelines_app/features/settings/settings_store.dart';
|
||||
|
||||
import 'fake_channel.dart';
|
||||
import 'settings_topic_test_helper.dart';
|
||||
import 'package:pipelines_app/ui/adaptive/segmented_bar.dart';
|
||||
|
||||
void main() {
|
||||
@@ -30,7 +31,7 @@ void main() {
|
||||
);
|
||||
|
||||
expect(find.text('Settings'), findsOneWidget);
|
||||
expect(find.text('Connection'), findsOneWidget);
|
||||
expect(find.text('Connection').last, findsOneWidget);
|
||||
expect(find.text('Workspace'), findsOneWidget);
|
||||
expect(find.text('Not connected'), findsOneWidget);
|
||||
expect(find.text('Saved workspace: /srv/pipelines'), findsOneWidget);
|
||||
@@ -163,7 +164,9 @@ void main() {
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(find.text('Connect'), findsNothing);
|
||||
// The only other request is the ntfy settings load, queued behind ping.
|
||||
// Notification settings are loaded only when their topic is opened.
|
||||
expect(factory.last.decodedOutgoing, hasLength(1));
|
||||
await selectSettingsTopic(tester, 'Notifications');
|
||||
_answerNtfySettings(factory.last);
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
@@ -205,6 +208,7 @@ void main() {
|
||||
expect(find.text(serverDetailsPending), findsNothing);
|
||||
expect(find.text('Server build unavailable'), findsOneWidget);
|
||||
expect(find.text('Server time unavailable'), findsOneWidget);
|
||||
await selectSettingsTopic(tester, 'Notifications');
|
||||
_answerNtfySettings(factory.last);
|
||||
await tester.pump();
|
||||
});
|
||||
@@ -284,7 +288,12 @@ void main() {
|
||||
await tester.scrollUntilVisible(
|
||||
find.byKey(SettingsKeys.saveWorkspace),
|
||||
200,
|
||||
scrollable: find.byType(Scrollable).first,
|
||||
scrollable: find
|
||||
.descendant(
|
||||
of: find.byKey(const ValueKey('settings-topic-connection')),
|
||||
matching: find.byType(Scrollable),
|
||||
)
|
||||
.first,
|
||||
);
|
||||
expect(find.byKey(SettingsKeys.saveWorkspace), findsOneWidget);
|
||||
expect(tester.takeException(), isNull);
|
||||
@@ -383,6 +392,7 @@ Future<void> _pump(
|
||||
);
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
await selectSettingsTopic(tester, 'Connection');
|
||||
return;
|
||||
}
|
||||
await tester.pumpWidget(
|
||||
@@ -402,6 +412,7 @@ Future<void> _pump(
|
||||
);
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
await selectSettingsTopic(tester, 'Connection');
|
||||
}
|
||||
|
||||
/// Answers the Settings screen's queued ntfy-settings load on [channel].
|
||||
|
||||
Reference in New Issue
Block a user