Skip to content

Commit b942ec2

Browse files
committed
content test [nfc]: Separate out some steps of prepareContentBare
1 parent c27ab80 commit b942ec2

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

test/widgets/content_test.dart

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,17 @@ void main() {
9393
TestZulipBinding.ensureInitialized();
9494

9595
Future<void> prepareContentBare(WidgetTester tester, String html) async {
96-
await tester.pumpWidget(Builder(
97-
builder: (context) {
98-
return MaterialApp(
96+
Widget widget = BlockContentList(nodes: parseContent(html).nodes);
97+
98+
widget = Scaffold(body: widget);
99+
100+
await tester.pumpWidget(
101+
Builder(builder: (context) =>
102+
MaterialApp(
99103
theme: ThemeData(typography: zulipTypography(context)),
100104
localizationsDelegates: ZulipLocalizations.localizationsDelegates,
101105
supportedLocales: ZulipLocalizations.supportedLocales,
102-
home: Scaffold(body: BlockContentList(nodes: parseContent(html).nodes)),
103-
);
104-
}
105-
));
106+
home: widget)));
106107
}
107108

108109
/// Test that the given content example renders without throwing an exception.

0 commit comments

Comments
 (0)