Skip to content

Commit b2e3ff6

Browse files
committed
theme test [nfc]: Simplify colorSwatchFor test
1 parent 1816786 commit b2e3ff6

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

test/widgets/theme_test.dart

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,14 @@ void main() {
8686
await tester.pumpWidget(const ZulipApp());
8787
await tester.pump();
8888

89-
late StreamColorSwatch actualSwatch;
9089
final navigator = await ZulipApp.navigator;
91-
navigator.push(MaterialWidgetRoute(page: Builder(builder: (context) {
92-
actualSwatch = colorSwatchFor(context, subscription);
93-
return const Placeholder();
94-
})));
90+
navigator.push(MaterialWidgetRoute(page: Builder(builder: (context) =>
91+
const Placeholder())));
9592
await tester.pumpAndSettle();
9693

94+
final element = tester.element(find.byType(Placeholder));
9795
// Compares all the swatch's members; see [ColorSwatch]'s `operator ==`.
98-
check(actualSwatch).equals(expected);
96+
check(colorSwatchFor(element, subscription)).equals(expected);
9997
});
10098
}
10199

0 commit comments

Comments
 (0)