feat(app): register native Settings on the shared live session

This commit is contained in:
2026-10-21 18:55:50 +01:00
parent 7b327f012b
commit d05aa0cfbc
15 changed files with 278 additions and 54 deletions
@@ -22,6 +22,32 @@ List<String> types(FakeChannel channel) => [
];
void main() {
test('Retry preserves an endpoint changed through shared Settings', () async {
final endpoints = <Uri>[];
final client = PipelinesClient(
channelFactory: (uri) {
endpoints.add(uri);
return FakeChannel()..readyCompleter.complete();
},
);
final session = AppSession(
endpoint: Uri.parse('ws://original.test/connect'),
client: client,
);
addTearDown(session.dispose);
await session.start();
final changed = Uri.parse('ws://selected.test/connect');
await session.client.connect(changed);
await session.stop();
await session.retry();
expect(endpoints, [
Uri.parse('ws://original.test/connect'),
changed,
changed,
]);
expect(session.endpoint, changed);
});
test(
'start subscribes once, stop unsubscribes, and the app owns the socket',
() async {