Skip to content

Commit c58c8b9

Browse files
chrisbobbegnprice
authored andcommitted
content [nfc]: Add wrapWithPerAccountStoreWidget to prepareContentBare
We'll use this soon.
1 parent 306cbec commit c58c8b9

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test/widgets/content_test.dart

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,16 @@ void main() {
9292

9393
TestZulipBinding.ensureInitialized();
9494

95-
Future<void> prepareContentBare(WidgetTester tester, String html) async {
95+
Future<void> prepareContentBare(WidgetTester tester, String html, {
96+
bool wrapWithPerAccountStoreWidget = false,
97+
}) async {
9698
Widget widget = BlockContentList(nodes: parseContent(html).nodes);
9799

100+
if (wrapWithPerAccountStoreWidget) {
101+
await testBinding.globalStore.add(eg.selfAccount, eg.initialSnapshot());
102+
widget = PerAccountStoreWidget(accountId: eg.selfAccount.id, child: widget);
103+
}
104+
98105
widget = GlobalStoreWidget(child: widget);
99106
addTearDown(testBinding.reset);
100107

@@ -106,6 +113,9 @@ void main() {
106113
supportedLocales: ZulipLocalizations.supportedLocales,
107114
home: widget)));
108115
await tester.pump(); // global store
116+
if (wrapWithPerAccountStoreWidget) {
117+
await tester.pump();
118+
}
109119
}
110120

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

0 commit comments

Comments
 (0)