Skip to content

Commit da94717

Browse files
committed
Fix new test
1 parent ec1a67a commit da94717

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/flutter/test/parse_client_configuration_test.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import 'package:parse_server_sdk_flutter/parse_server_sdk_flutter.dart';
33
import 'package:shared_preferences/shared_preferences.dart';
44

55
void main() {
6+
TestWidgetsFlutterBinding.ensureInitialized();
67
SharedPreferences.setMockInitialValues(<String, String>{});
78

89
test('testBuilder', () async {
@@ -40,24 +41,30 @@ void main() {
4041
});
4142

4243
test('testDefaultValues', () async {
43-
// arrange - initialize with only required parameters
44+
// arrange - initialize with minimal parameters to test defaults
4445
await Parse().initialize(
4546
'appId',
4647
'serverUrl',
4748
appName: 'appName',
4849
appPackageName: 'somePackageName',
4950
appVersion: 'someAppVersion',
51+
fileDirectory: 'someDirectory',
5052
);
5153

5254
// assert - verify default values are used
5355
expect(ParseCoreData().applicationId, 'appId');
5456
expect(ParseCoreData().serverUrl, 'serverUrl');
57+
expect(ParseCoreData().appName, 'appName');
58+
expect(ParseCoreData().appPackageName, 'somePackageName');
59+
expect(ParseCoreData().appVersion, 'someAppVersion');
5560
expect(ParseCoreData().debug, false); // default
5661
expect(ParseCoreData().autoSendSessionId, true); // default
5762
expect(ParseCoreData().clientKey, null); // not provided
5863
expect(ParseCoreData().masterKey, null); // not provided
5964
expect(ParseCoreData().sessionId, null); // not provided
6065
expect(ParseCoreData().liveQueryURL, null); // not provided
66+
// Note: default retry values mirror parse_server_sdk defaults and may need
67+
// updating if those change in future versions
6168
expect(ParseCoreData().restRetryIntervals, [0, 250, 500, 1000, 2000]);
6269
expect(ParseCoreData().restRetryIntervalsForWrites, <int>[]);
6370
});

0 commit comments

Comments
 (0)