From 2671fb3f440764a3827afe0a952722e11b4f1945 Mon Sep 17 00:00:00 2001 From: Talha Date: Tue, 14 Nov 2023 17:13:27 +0500 Subject: [PATCH] correct tests --- example/pubspec.lock | 2 +- test/acter_avatar_test.dart | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index 9402b43..aac114e 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -7,7 +7,7 @@ packages: path: ".." relative: true source: path - version: "1.0.0+1" + version: "1.0.0+2" args: dependency: transitive description: diff --git a/test/acter_avatar_test.dart b/test/acter_avatar_test.dart index 1f76dcb..15bd5e9 100644 --- a/test/acter_avatar_test.dart +++ b/test/acter_avatar_test.dart @@ -29,8 +29,9 @@ void main() { tester.getSize(find.byKey(TestKeys.circleAvatarKey)); // should expect specified fallback size - expect(avatarSize.height, equals(36)); - expect(avatarSize.width, equals(36)); + // diameter (size) is twice of radius size so we would expect x2 of specified size + expect(avatarSize.height, equals(36 * 2)); + expect(avatarSize.width, equals(36 * 2)); }); testWidgets('User Circle Avatar with fallback size', (WidgetTester tester) async { @@ -225,14 +226,16 @@ void main() { tester.getSize(find.byKey(TestKeys.stackedAvatarKey)); // should expect first avatar specified size - expect(avatarSize.height, equals(24)); - expect(avatarSize.width, equals(24)); + // diameter (size) is twice of radius size so we would expect x2 of specified size + expect(avatarSize.height, equals(24 * 2)); + expect(avatarSize.width, equals(24 * 2)); final secondAvatarSize = tester.getSize(find.byType(Positioned)); // should expect second avatar specified size - expect(secondAvatarSize.height, equals(24)); - expect(secondAvatarSize.width, equals(24)); + // diameter (size) is twice of radius size so we would expect x2 of specified size + expect(secondAvatarSize.height, equals(24 * 2)); + expect(secondAvatarSize.width, equals(24 * 2)); }); testWidgets('Circular Stacked Avatars with fallback size', (WidgetTester tester) async {