Skip to content

Commit 80dc486

Browse files
test(integration): simplify policy manager retrieval and enhance widget test assertions
1 parent a66b6b7 commit 80dc486

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

test/core/integration_test.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import 'package:flutter_policy_engine/flutter_policy_engine.dart';
22
import 'package:flutter_test/flutter_test.dart';
3-
import 'package:flutter_policy_engine/src/core/policy_manager.dart';
43
import 'package:flutter_policy_engine/src/core/memory_policy_storage.dart';
54
import 'package:flutter_policy_engine/src/core/role_evaluator.dart';
6-
import 'package:flutter_policy_engine/src/exceptions/policy_sdk_exception.dart';
75

86
void main() {
97
group('Core Integration Tests', () {

test/core/policy_provider_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ class TestConsumerWidget extends StatelessWidget {
5555
Builder(
5656
builder: (context) {
5757
try {
58-
final policyManager = PolicyProvider.policyManagerOf(context);
59-
return Text('manager_found: ${policyManager != null}');
58+
final _ = PolicyProvider.policyManagerOf(context);
59+
return const Text('manager_found: true');
6060
} catch (e) {
6161
return Text('error: ${e.toString()}');
6262
}
@@ -388,7 +388,7 @@ void main() {
388388
PolicyProvider(
389389
policyManager: policyManager,
390390
child: const Column(
391-
children: const [
391+
children: [
392392
TestConsumerWidget(),
393393
TestConsumerWidget(),
394394
RebuildTestWidget(),

test/exceptions/policy_sdk_exception_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ void main() {
9494
const message = 'Failed to load policy configuration';
9595

9696
// Test with FormatException
97-
final formatError = FormatException('Invalid format');
97+
const formatError = FormatException('Invalid format');
9898
final exceptionWithFormatError = PolicySDKException(
9999
message,
100100
exception: formatError,

0 commit comments

Comments
 (0)