fbe1928f59
Keep the existing Material transcript path while preserving public Cupertino parameters for callers. Narrow transcript tests to the Material-only behavior and remove Cupertino-only fixtures.
33 lines
887 B
Dart
33 lines
887 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:pipelines_app/features/chat/ui/transcript/native_disclosure.dart';
|
|
|
|
Widget _material(WidgetBuilder body) => MaterialApp(
|
|
theme: ThemeData(brightness: Brightness.dark),
|
|
home: Scaffold(
|
|
body: NativeDisclosure(label: 'Body', childBuilder: body),
|
|
),
|
|
);
|
|
|
|
void main() {
|
|
testWidgets('closed Material disclosure never builds its body', (
|
|
tester,
|
|
) async {
|
|
var builds = 0;
|
|
await tester.pumpWidget(
|
|
_material((context) {
|
|
builds++;
|
|
return const Text('body');
|
|
}),
|
|
);
|
|
await tester.pumpAndSettle();
|
|
expect(builds, 0);
|
|
expect(find.text('body'), findsNothing);
|
|
|
|
await tester.tap(find.text('Body'));
|
|
await tester.pumpAndSettle();
|
|
expect(builds, greaterThan(0));
|
|
expect(find.text('body'), findsOneWidget);
|
|
});
|
|
}
|