feat(app): phone onboarding (server, then password) kept across launches; a known server opens straight into the app; a refused session asks for the password
This commit is contained in:
@@ -26,29 +26,25 @@ class _TestSettingsStore implements SettingsStore {
|
||||
void main() {
|
||||
const nativeBase = 'http://127.0.0.1:8096/';
|
||||
|
||||
test(
|
||||
'uses saved endpoint natively only when build configuration is blank',
|
||||
() async {
|
||||
final store = _TestSettingsStore('wss://saved.example.test');
|
||||
final saved = await resolveLaunchServer(
|
||||
base: Uri.parse(nativeBase),
|
||||
configured: '',
|
||||
web: false,
|
||||
settingsStore: store,
|
||||
);
|
||||
expect(saved.uri, Uri.parse('wss://saved.example.test/connect'));
|
||||
expect(store.loads, 1);
|
||||
test('a saved endpoint wins over the build default on a phone', () async {
|
||||
final store = _TestSettingsStore('wss://saved.example.test');
|
||||
final saved = await resolveLaunchServer(
|
||||
base: Uri.parse(nativeBase),
|
||||
configured: 'ws://build.example.test',
|
||||
web: false,
|
||||
settingsStore: store,
|
||||
);
|
||||
expect(saved.uri, Uri.parse('wss://saved.example.test/connect'));
|
||||
|
||||
final configured = await resolveLaunchServer(
|
||||
base: Uri.parse(nativeBase),
|
||||
configured: 'ws://build.example.test',
|
||||
web: false,
|
||||
settingsStore: store,
|
||||
);
|
||||
expect(configured.uri, Uri.parse('ws://build.example.test/connect'));
|
||||
expect(store.loads, 1);
|
||||
},
|
||||
);
|
||||
// Nothing saved yet: the build default stands (and pre-fills onboarding).
|
||||
final fallback = await resolveLaunchServer(
|
||||
base: Uri.parse(nativeBase),
|
||||
configured: 'ws://build.example.test',
|
||||
web: false,
|
||||
settingsStore: _TestSettingsStore(''),
|
||||
);
|
||||
expect(fallback.uri, Uri.parse('ws://build.example.test/connect'));
|
||||
});
|
||||
|
||||
test(
|
||||
'blank or failed settings load leaves native configuration required',
|
||||
|
||||
Reference in New Issue
Block a user