feat(app): configure and safely switch multi-address servers
This commit is contained in:
@@ -5,6 +5,8 @@ import 'package:pipelines_app/application/server_endpoint.dart';
|
||||
import 'package:pipelines_app/core/session/server_session.dart';
|
||||
import 'package:pipelines_app/features/onboarding/onboarding_flow.dart';
|
||||
import 'package:pipelines_app/features/settings/settings_store.dart';
|
||||
import 'package:pipelines_app/core/servers/server_catalog_store.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
class _Store implements SettingsStore {
|
||||
@override
|
||||
@@ -24,6 +26,10 @@ ServerEndpoint _server(String url) => ServerEndpoint.resolve(
|
||||
);
|
||||
|
||||
void main() {
|
||||
setUp(() async {
|
||||
SharedPreferences.setMockInitialValues({});
|
||||
await ServerSession.load();
|
||||
});
|
||||
testWidgets(
|
||||
'a first launch starts at the server, pre-filled from the build',
|
||||
(tester) async {
|
||||
@@ -33,6 +39,7 @@ void main() {
|
||||
buildDefault: 'wss://build.example/connect',
|
||||
check: (_) async => SessionState.signedOut,
|
||||
settingsStore: _Store(),
|
||||
catalogStore: MemoryServerCatalogStore(),
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
@@ -52,6 +59,7 @@ void main() {
|
||||
signedIn: false,
|
||||
check: (_) async => SessionState.signedOut,
|
||||
settingsStore: _Store(),
|
||||
catalogStore: MemoryServerCatalogStore(),
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
Reference in New Issue
Block a user