Skip to content

Commit

Permalink
Updated test for App.updateBaseUrl()
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Wilkerson-Barker authored and nielsenko committed Jan 29, 2024
1 parent 0d6ff75 commit b2742c8
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions test/app_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -322,17 +322,12 @@ void main() {
final credentials = Credentials.anonymous();
await app.logIn(credentials);
final baseUrl = app.getBaseUrl();
final urlString = baseUrl?.toString() ?? configuration.baseUrl.toString();
// Grab an alternate address for the original baseUrl
List<InternetAddress> addrs = await InternetAddress.lookup(urlString, type: InternetAddressType.IPv4);
var newUrl;
if (addrs.isNotEmpty) {
newUrl = addrs[0].toString();
}
await app.updateBaseUrl(Uri.parse(newUrl));
expect(baseUrl, isNotNull);
// Set it to the same thing to confirm the function works, it's not actually going to update the location
await app.updateBaseUrl(baseUrl!);
final newBaseUrl = app.getBaseUrl();
expect(newBaseUrl, isNotNull);
expect(newBaseUrl, configuration.baseUrl);
expect(newBaseUrl, baseUrl);
});

test('bundleId is salted, hashed and encoded', () {
Expand Down

0 comments on commit b2742c8

Please sign in to comment.