Skip to content

Commit 4396a17

Browse files
committed
test: added loop for zetaavatar with border color for $size
1 parent 0fa93b5 commit 4396a17

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

test/src/components/avatar/avatar_test.dart

+20-15
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,10 @@ void main() {
149149
);
150150

151151
final avatarSize = tester.getSize(find.byType(ZetaAvatar));
152-
final typeSize = ZetaAvatar.pixelSize(tester.element(find.byType(ZetaAvatar)),
153-
size,); //TODO BK butchered this to make pixelSize reusable. Mike, is this ok?
152+
final typeSize = ZetaAvatar.pixelSize(
153+
tester.element(find.byType(ZetaAvatar)),
154+
size,
155+
); //TODO BK butchered this to make pixelSize reusable. Mike, is this ok?
154156

155157
expect(avatarSize.width, equals(typeSize));
156158
expect(avatarSize.height, equals(typeSize));
@@ -273,21 +275,24 @@ void main() {
273275
expect(avatarBackgroundColor, equals(Colors.red));
274276
});
275277

276-
testWidgets('ZetaAvatar with border colour', (WidgetTester tester) async {
277-
await tester.pumpWidget(
278-
const TestApp(
279-
home: ZetaAvatar(
280-
borderColor: Colors.red,
278+
for (final size in ZetaAvatarSize.values) {
279+
testWidgets('ZetaAvatar with border colour for $size', (WidgetTester tester) async {
280+
await tester.pumpWidget(
281+
TestApp(
282+
home: ZetaAvatar(
283+
borderColor: Colors.red,
284+
size: size,
285+
),
281286
),
282-
),
283-
);
287+
);
284288

285-
final avatarBorderColor =
286-
(((tester.firstWidget(find.byType(Container)) as Container).decoration! as BoxDecoration).border! as Border)
287-
.top
288-
.color;
289-
expect(avatarBorderColor, equals(Colors.red));
290-
});
289+
final avatarBorderColor =
290+
(((tester.firstWidget(find.byType(Container)) as Container).decoration! as BoxDecoration).border! as Border)
291+
.top
292+
.color;
293+
expect(avatarBorderColor, equals(Colors.red));
294+
});
295+
}
291296
});
292297

293298
group('ZetaAvatar Interaction Tests', () {});

0 commit comments

Comments
 (0)