Skip to content

Commit 4ccc498

Browse files
committed
Format
1 parent 0a45970 commit 4ccc498

File tree

4 files changed

+35
-20
lines changed

4 files changed

+35
-20
lines changed

packages/common_client/test/data_sources/data_source_event_handler_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ void main() {
9595
emits(DataSourceStatus(
9696
state: DataSourceState.valid, stateSince: DateTime(2))));
9797

98-
expectLater(flagManager!.changes,
99-
emits(FlagsChangedEvent(keys: ['HasBob'])));
98+
expectLater(
99+
flagManager!.changes, emits(FlagsChangedEvent(keys: ['HasBob'])));
100100

101101
eventHandler!.handleMessage(
102102
context,
@@ -120,8 +120,8 @@ void main() {
120120
emits(DataSourceStatus(
121121
state: DataSourceState.valid, stateSince: DateTime(2))));
122122

123-
expectLater(flagManager!.changes,
124-
emits(FlagsChangedEvent(keys: ['HasBob'])));
123+
expectLater(
124+
flagManager!.changes, emits(FlagsChangedEvent(keys: ['HasBob'])));
125125

126126
eventHandler!.handleMessage(
127127
context,

packages/common_client/test/data_sources/get_environment_id_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ void main() {
3838
expect(result, 'env-123-abc-456');
3939
});
4040
});
41-
}
41+
}

packages/common_client/test/data_sources/polling_data_source_test.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,8 @@ void main() {
394394
var receivedEnvironmentId = '';
395395

396396
final innerClient = MockClient((request) async {
397-
return http.Response(flagData, 200, headers: {'x-ld-envid': 'env-123-test'});
397+
return http.Response(flagData, 200,
398+
headers: {'x-ld-envid': 'env-123-test'});
398399
});
399400

400401
final context = LDContextBuilder().kind('user', 'test').build();
@@ -417,8 +418,8 @@ void main() {
417418
withReasons: false,
418419
useReport: false),
419420
httpProperties: HttpProperties(),
420-
clientFactory: (properties) =>
421-
ld_common.HttpClient(client: innerClient, httpProperties: properties),
421+
clientFactory: (properties) => ld_common.HttpClient(
422+
client: innerClient, httpProperties: properties),
422423
testingInterval: Duration(milliseconds: 50));
423424

424425
polling.events.asyncMap((event) async {
@@ -478,8 +479,8 @@ void main() {
478479
withReasons: false,
479480
useReport: false),
480481
httpProperties: HttpProperties(),
481-
clientFactory: (properties) =>
482-
ld_common.HttpClient(client: innerClient, httpProperties: properties),
482+
clientFactory: (properties) => ld_common.HttpClient(
483+
client: innerClient, httpProperties: properties),
483484
testingInterval: Duration(milliseconds: 50));
484485

485486
polling.events.asyncMap((event) async {

packages/common_client/test/flag_persistence_test.dart

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -349,10 +349,12 @@ void main() {
349349

350350
final context = LDContextBuilder().kind('user', 'user-key').build();
351351

352-
await flagPersistence.init(context, basicData, environmentId: 'test-env-123');
352+
await flagPersistence.init(context, basicData,
353+
environmentId: 'test-env-123');
353354

354355
// Environment ID should be stored separately
355-
expect(mockPersistence.storage[sdkKeyPersistence]!['EnvironmentId'], 'test-env-123');
356+
expect(mockPersistence.storage[sdkKeyPersistence]!['EnvironmentId'],
357+
'test-env-123');
356358
});
357359

358360
test('it loads environment ID from persistence', () async {
@@ -396,7 +398,8 @@ void main() {
396398
expect(flagStore.environmentId, 'cached-env-456');
397399
});
398400

399-
test('it handles missing environment ID in persistence gracefully', () async {
401+
test('it handles missing environment ID in persistence gracefully',
402+
() async {
400403
final context = LDContextBuilder().kind('user', 'user-key').build();
401404
final contextPersistenceKey =
402405
sha256.convert(utf8.encode(context.canonicalKey)).toString();
@@ -430,7 +433,8 @@ void main() {
430433
expect(flagStore.environmentId, null);
431434
});
432435

433-
test('it does not store environment ID when maxCachedContexts is 0', () async {
436+
test('it does not store environment ID when maxCachedContexts is 0',
437+
() async {
434438
final flagStore = FlagStore();
435439
final mockPersistence = MockPersistence();
436440
final flagPersistence = FlagPersistence(
@@ -444,14 +448,20 @@ void main() {
444448

445449
final context = LDContextBuilder().kind('user', 'user-key').build();
446450

447-
await flagPersistence.init(context, basicData, environmentId: 'test-env-123');
451+
await flagPersistence.init(context, basicData,
452+
environmentId: 'test-env-123');
448453

449454
// Only the index should be stored, not the context data or environment ID
450-
expect(mockPersistence.storage[sdkKeyPersistence]!.containsKey('EnvironmentId'), false);
451-
expect(mockPersistence.storage[sdkKeyPersistence]!.length, 1); // Just the index
455+
expect(
456+
mockPersistence.storage[sdkKeyPersistence]!
457+
.containsKey('EnvironmentId'),
458+
false);
459+
expect(mockPersistence.storage[sdkKeyPersistence]!.length,
460+
1); // Just the index
452461
});
453462

454-
test('it does not store environment ID when environment ID is null', () async {
463+
test('it does not store environment ID when environment ID is null',
464+
() async {
455465
final flagStore = FlagStore();
456466
final mockPersistence = MockPersistence();
457467
final flagPersistence = FlagPersistence(
@@ -465,10 +475,14 @@ void main() {
465475

466476
final context = LDContextBuilder().kind('user', 'user-key').build();
467477

468-
await flagPersistence.init(context, basicData); // No environment ID provided
478+
await flagPersistence.init(
479+
context, basicData); // No environment ID provided
469480

470481
// Environment ID should not be in storage when it's null
471-
expect(mockPersistence.storage[sdkKeyPersistence]!.containsKey('EnvironmentId'), false);
482+
expect(
483+
mockPersistence.storage[sdkKeyPersistence]!
484+
.containsKey('EnvironmentId'),
485+
false);
472486
});
473487
});
474488

0 commit comments

Comments
 (0)