test: cover ClideKernel.of throw branch (T-91)

One small addition to facade_test: ClideKernel.of called from a
Builder with no ClideKernel ancestor throws the documented
FlutterError. Mirrors the existing ClideTheme.of coverage.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-14 10:05:12 +02:00
co-authored by Claude Opus 4.7
parent fb48a3133f
commit 14d73b618f
+18
View File
@@ -1,5 +1,7 @@
import 'dart:ui';
import 'package:clide/kernel/kernel.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
import '../../helpers/kernel_fixture.dart';
@@ -59,5 +61,21 @@ void main() {
final f = await KernelFixture.create();
await f.dispose();
});
testWidgets('ClideKernel.of throws a FlutterError when no ancestor exists', (tester) async {
late Object captured;
await tester.pumpWidget(Directionality(
textDirection: TextDirection.ltr,
child: Builder(builder: (ctx) {
try {
ClideKernel.of(ctx);
} catch (e) {
captured = e;
}
return const SizedBox();
}),
));
expect(captured, isA<FlutterError>());
});
});
}