Skip to content

Commit 3ac8cec

Browse files
committed
theme test [nfc]: Remove a doTest helper that we don't want anymore
We can check the dark and lerped states conveniently without using this helper.
1 parent b2e3ff6 commit 3ac8cec

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

test/widgets/theme_test.dart

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -77,27 +77,27 @@ void main() {
7777
});
7878

7979
group('colorSwatchFor', () {
80-
void doTest(String description, int baseColor, StreamColorSwatch expected) {
81-
testWidgets('$description $baseColor', (WidgetTester tester) async {
82-
addTearDown(testBinding.reset);
80+
const baseColor = 0xff76ce90;
8381

84-
final subscription = eg.subscription(eg.stream(), color: baseColor);
82+
testWidgets('light $baseColor', (WidgetTester tester) async {
83+
addTearDown(testBinding.reset);
8584

86-
await tester.pumpWidget(const ZulipApp());
87-
await tester.pump();
85+
final subscription = eg.subscription(eg.stream(), color: baseColor);
8886

89-
final navigator = await ZulipApp.navigator;
90-
navigator.push(MaterialWidgetRoute(page: Builder(builder: (context) =>
91-
const Placeholder())));
92-
await tester.pumpAndSettle();
87+
await tester.pumpWidget(const ZulipApp());
88+
await tester.pump();
9389

94-
final element = tester.element(find.byType(Placeholder));
95-
// Compares all the swatch's members; see [ColorSwatch]'s `operator ==`.
96-
check(colorSwatchFor(element, subscription)).equals(expected);
97-
});
98-
}
90+
final navigator = await ZulipApp.navigator;
91+
navigator.push(MaterialWidgetRoute(page: Builder(builder: (context) =>
92+
const Placeholder())));
93+
await tester.pumpAndSettle();
94+
95+
final element = tester.element(find.byType(Placeholder));
96+
// Compares all the swatch's members; see [ColorSwatch]'s `operator ==`.
97+
check(colorSwatchFor(element, subscription))
98+
.equals(StreamColorSwatch.light(baseColor));
99+
});
99100

100-
doTest('light', 0xff76ce90, StreamColorSwatch.light(0xff76ce90));
101101
// TODO(#95) test with Brightness.dark and lerping between light/dark
102102
});
103103
}

0 commit comments

Comments
 (0)