anchor.diff:      when(client.get(apiVersionEndpoint))
           .thenAnswer((_) async => Response(compatibleAPIVersion, 200));
   
  -    await tester.enterText(urlInputField, host);
  +    await tester.enterText(urlInputField, hostURL);
       await tester.tap(connectButton);
       await tester.pump();
       expect(urlInputField, findsNothing);
  +  });
  +
  +  testWidgets('Reconnects on startup', (WidgetTester tester) async {
  +    await _setup(connect: true);
  +
  +    await tester.pumpWidget(PolarisApp());
  +
  +    final Finder connectButton =
  +        find.widgetWithText(ElevatedButton, connectButtonLabel);
  +    final Finder disconnectButton =
  +        find.widgetWithText(FlatButton, disconnectButtonLabel);
  +
  +    expect(connectButton, findsNothing);
  +    expect(disconnectButton, findsOneWidget);
     });
   
     testWidgets('Disconnect returns to connect screen',
  
positive.code:     final client = getIt<Client>();
      when(client.get(apiVersionEndpoint)).thenThrow('bad host');
  
      await tester.enterText(urlInputField, host);
      await tester.tap(connectButton);
      await tester.pump();
      expect(find.widgetWithText(SnackBar, errorNetwork), findsOneWidget);
  
negative.code: 
  class MockClient extends Mock implements Client {}
  
  final hostURL = 'my-polaris-server';
  final apiVersionEndpoint = hostURL + '/api/version';
  final compatibleAPIVersion = '{"major": 6, "minor": 0}';
  final incompatibleAPIVersion = '{"major": 5, "minor": 0}';
  
  Future _setup({bool connect = false}) async {
    var preferences = Map<String, dynamic>();
    if (connect) {
      preferences[serverURLKey] = hostURL;
    }
    SharedPreferences.setMockInitialValues(preferences);
  
    var host = await Host.create();
    getIt.allowReassignment = true;
    getIt.registerSingleton<Host>(host);
    getIt.registerSingleton<Client>(MockClient());
    if (connect) {
      final client = getIt<Client>();
      when(client.get(apiVersionEndpoint))
          .thenAnswer((_) async => Response(compatibleAPIVersion, 200));
    }
  
    getIt.registerSingleton<API>(HttpAPI());
    getIt.registerSingleton<connection.Manager>(connection.Manager());
  }
  