diff --git a/app/test/application/app_lifecycle_reconnect_test.dart b/app/test/application/app_lifecycle_reconnect_test.dart index e2fff246..73cb9962 100644 --- a/app/test/application/app_lifecycle_reconnect_test.dart +++ b/app/test/application/app_lifecycle_reconnect_test.dart @@ -56,10 +56,7 @@ void main() { }); test('only a dropped socket is reopened on foreground', () { - expect( - shouldReconnectOnForeground(ConnectionKind.disconnected), - isTrue, - ); + expect(shouldReconnectOnForeground(ConnectionKind.disconnected), isTrue); // A deliberate Disconnect reaches idle and must stay disconnected. expect(shouldReconnectOnForeground(ConnectionKind.idle), isFalse); // These states already have their own answer; foregrounding does not churn diff --git a/app/test/features/settings/settings_controller_test.dart b/app/test/features/settings/settings_controller_test.dart index 50479e86..9f50986c 100644 --- a/app/test/features/settings/settings_controller_test.dart +++ b/app/test/features/settings/settings_controller_test.dart @@ -406,53 +406,50 @@ void main() { await client.dispose(); }); - test( - 'a mismatched protocol warns and the warning survives a drop', - () async { - final factory = FakeChannelFactory(); - final client = transport.PipelinesClient(channelFactory: factory.call); - final controller = SettingsController( - client: client, - store: MemorySettingsStore(), - ); - await controller.initialize(); - controller.updateServerUrl('ws://example.test:8123'); - final connecting = controller.connect(); - await settle(); - factory.last.markReady(); - await connecting; - await settle(); - expect(controller.protocolWarning, isNull); + test('a mismatched protocol warns and the warning survives a drop', () async { + final factory = FakeChannelFactory(); + final client = transport.PipelinesClient(channelFactory: factory.call); + final controller = SettingsController( + client: client, + store: MemorySettingsStore(), + ); + await controller.initialize(); + controller.updateServerUrl('ws://example.test:8123'); + final connecting = controller.connect(); + await settle(); + factory.last.markReady(); + await connecting; + await settle(); + expect(controller.protocolWarning, isNull); - factory.last.reply({ - 'id': factory.last.decodedOutgoing.single['id'], - 'type': 'pong', - // The server sends an integer, but the comparison is numeric, like the - // web page's Number() rule. - 'protocol': '2', - }); - await settle(); - expect( - controller.protocolWarning, - 'Protocol mismatch: this page speaks protocol 1, ' - 'the server reports 2.', - ); + factory.last.reply({ + 'id': factory.last.decodedOutgoing.single['id'], + 'type': 'pong', + // The server sends an integer, but the comparison is numeric, like the + // web page's Number() rule. + 'protocol': '2', + }); + await settle(); + expect( + controller.protocolWarning, + 'Protocol mismatch: this page speaks protocol 1, ' + 'the server reports 2.', + ); - factory.last.fail('socket gone'); - await settle(); - expect(controller.connection.kind, transport.ConnectionKind.disconnected); - expect( - controller.protocolWarning, - isNotNull, - reason: 'a known mismatch stays visible while the socket reconnects', - ); + factory.last.fail('socket gone'); + await settle(); + expect(controller.connection.kind, transport.ConnectionKind.disconnected); + expect( + controller.protocolWarning, + isNotNull, + reason: 'a known mismatch stays visible while the socket reconnects', + ); - // Cancel the client's scheduled retry before the test ends. - await client.disconnect(); - controller.dispose(); - await client.dispose(); - }, - ); + // Cancel the client's scheduled retry before the test ends. + await client.disconnect(); + controller.dispose(); + await client.dispose(); + }); test('protocolMismatchWarning ignores matching and absent protocols', () { expect(protocolMismatchWarning(null), isNull);