feat(remote): remember manual host address

close #1074
This commit is contained in:
edde746
2026-05-18 17:22:10 +02:00
parent a679bae354
commit 68e27fdbb3
3 changed files with 65 additions and 14 deletions
+23
View File
@@ -74,6 +74,29 @@ void main() {
});
});
group('SettingsService companion remote prefs', () {
test('last manual host address trims whitespace and drops blanks', () async {
final settings = await SettingsService.getInstance();
await settings.write(SettingsService.companionRemoteLastHostAddress, ' 192.168.1.10:48632 ');
expect(settings.read(SettingsService.companionRemoteLastHostAddress), '192.168.1.10:48632');
await settings.write(SettingsService.companionRemoteLastHostAddress, ' ');
expect(settings.read(SettingsService.companionRemoteLastHostAddress), isNull);
});
test('resetAllSettings clears the last manual host address', () async {
final settings = await SettingsService.getInstance();
await settings.write(SettingsService.companionRemoteLastHostAddress, '192.168.1.10:48632');
expect(settings.read(SettingsService.companionRemoteLastHostAddress), isNotNull);
await settings.resetAllSettings();
expect(settings.read(SettingsService.companionRemoteLastHostAddress), isNull);
});
});
group('SettingsService listenables', () {
test('refreshListenables updates active prefs outside the resettable surface', () async {
final settings = await SettingsService.getInstance();