feat(app): register native Settings on the shared live session
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user