Unverified Commit a4af12f4 authored by Bruno Leroux's avatar Bruno Leroux Committed by GitHub

Update app_builder_test.dart for M3 (#130794)

This PR updates unit tests from app_builder_test.dart for M3 migration.

More info in https://github.com/flutter/flutter/issues/127064

In this particular case, I choose to make the tests Material-agnostic by removing the color theming which was not meaningful to what is tested here.
parent d2110922
...@@ -9,14 +9,9 @@ void main() { ...@@ -9,14 +9,9 @@ void main() {
testWidgets("builder doesn't get called if app doesn't change", (WidgetTester tester) async { testWidgets("builder doesn't get called if app doesn't change", (WidgetTester tester) async {
final List<String> log = <String>[]; final List<String> log = <String>[];
final Widget app = MaterialApp( final Widget app = MaterialApp(
theme: ThemeData(
useMaterial3: false,
primarySwatch: Colors.green,
),
home: const Placeholder(), home: const Placeholder(),
builder: (BuildContext context, Widget? child) { builder: (BuildContext context, Widget? child) {
log.add('build'); log.add('build');
expect(Theme.of(context).primaryColor, Colors.green);
expect(Directionality.of(context), TextDirection.ltr); expect(Directionality.of(context), TextDirection.ltr);
expect(child, isA<FocusScope>()); expect(child, isA<FocusScope>());
return const Placeholder(); return const Placeholder();
...@@ -42,14 +37,9 @@ void main() { ...@@ -42,14 +37,9 @@ void main() {
final List<String> log = <String>[]; final List<String> log = <String>[];
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeData(
useMaterial3: false,
primarySwatch: Colors.yellow,
),
home: Builder( home: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
log.add('build'); log.add('build');
expect(Theme.of(context).primaryColor, Colors.yellow);
expect(Directionality.of(context), TextDirection.rtl); expect(Directionality.of(context), TextDirection.rtl);
return const Placeholder(); return const Placeholder();
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment