@@ -134,12 +134,32 @@ void main() {
134
134
return findRowByLabel (tester, 'Direct messages' );
135
135
}
136
136
137
+ Color ? allDmsHeaderBackgroundColor (WidgetTester tester) {
138
+ final row = findAllDmsHeaderRow (tester);
139
+ check (row).isNotNull ();
140
+ final material = tester.firstWidget <Material >(
141
+ find.ancestor (
142
+ of: find.byWidget (row! ),
143
+ matching: find.byType (Material )));
144
+ return material.color;
145
+ }
146
+
137
147
/// For the given stream ID, find the stream header element.
138
148
Widget ? findStreamHeaderRow (WidgetTester tester, int streamId) {
139
149
final stream = store.streams[streamId]! ;
140
150
return findRowByLabel (tester, stream.name);
141
151
}
142
152
153
+ Color ? streamHeaderBackgroundColor (WidgetTester tester, int streamId) {
154
+ final row = findStreamHeaderRow (tester, streamId);
155
+ check (row).isNotNull ();
156
+ final material = tester.firstWidget <Material >(
157
+ find.ancestor (
158
+ of: find.byWidget (row! ),
159
+ matching: find.byType (Material )));
160
+ return material.color;
161
+ }
162
+
143
163
IconData expectedStreamHeaderIcon (int streamId) {
144
164
final subscription = store.subscriptions[streamId]! ;
145
165
return switch (subscription) {
@@ -310,7 +330,8 @@ void main() {
310
330
check (headerRow).isNotNull ();
311
331
final icon = findHeaderCollapseIcon (tester, headerRow! );
312
332
check (icon).icon.equals (ZulipIcons .arrow_down);
313
- // TODO check bar background color
333
+ check (allDmsHeaderBackgroundColor (tester))
334
+ .isNotNull ().equals (const HSLColor .fromAHSL (1 , 46 , 0.35 , 0.93 ).toColor ());
314
335
check (tester.widgetList (findSectionContent)).isNotEmpty ();
315
336
}
316
337
@@ -327,7 +348,8 @@ void main() {
327
348
check (headerRow).isNotNull ();
328
349
final icon = findHeaderCollapseIcon (tester, headerRow! );
329
350
check (icon).icon.equals (ZulipIcons .arrow_right);
330
- // TODO check bar background color
351
+ check (allDmsHeaderBackgroundColor (tester))
352
+ .isNotNull ().equals (Colors .white);
331
353
check (tester.widgetList (findSectionContent)).isEmpty ();
332
354
}
333
355
@@ -403,7 +425,8 @@ void main() {
403
425
check (collapseIcon).icon.equals (ZulipIcons .arrow_down);
404
426
final streamIcon = findStreamHeaderIcon (tester, streamId);
405
427
check (streamIcon).color.equals (subscription.colorSwatch ().iconOnBarBackground);
406
- // TODO check bar background color
428
+ check (streamHeaderBackgroundColor (tester, streamId))
429
+ .isNotNull ().equals (subscription.colorSwatch ().barBackground);
407
430
check (tester.widgetList (findSectionContent)).isNotEmpty ();
408
431
}
409
432
@@ -424,7 +447,8 @@ void main() {
424
447
check (collapseIcon).icon.equals (ZulipIcons .arrow_right);
425
448
final streamIcon = findStreamHeaderIcon (tester, streamId);
426
449
check (streamIcon).color.equals (subscription.colorSwatch ().iconOnPlainBackground);
427
- // TODO check bar background color
450
+ check (streamHeaderBackgroundColor (tester, streamId))
451
+ .isNotNull ().equals (Colors .white);
428
452
check (tester.widgetList (findSectionContent)).isEmpty ();
429
453
}
430
454
0 commit comments