Skip to content

Commit

Permalink
test: hardcoded offset
Browse files Browse the repository at this point in the history
  • Loading branch information
DE7924 committed Nov 15, 2024
1 parent 2e2a8ff commit ce9c3d6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/src/components/navigation_bar/navigation_bar_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ void main() {

const items = [
ZetaNavigationBarItem(
icon: ZetaIcons.star,
label: 'Label0',
badge: ZetaIndicator(
value: 2,
),),
icon: ZetaIcons.star,
label: 'Label0',
badge: ZetaIndicator(
value: 2,
),
),
ZetaNavigationBarItem(icon: ZetaIcons.star, label: 'Label1', badge: ZetaIndicator(value: 2)),
ZetaNavigationBarItem(icon: ZetaIcons.star, label: 'Label2'),
ZetaNavigationBarItem(icon: ZetaIcons.star, label: 'Label3'),
Expand Down Expand Up @@ -428,14 +429,13 @@ void main() {
);

final itemFinder = find.byType(NavigationItem).first;
final offset = tester.getSize(itemFinder).width / 4;

await tester.tapAt(tester.getCenter(itemFinder) + Offset(offset, 0));
await tester.tapAt(tester.getCenter(itemFinder) + const Offset(80, 0));
expect(tappedIndex, 0);

final lastItemFinder = find.byType(NavigationItem).last;

await tester.tapAt(tester.getCenter(lastItemFinder) + Offset(-offset, 0));
await tester.tapAt(tester.getCenter(lastItemFinder) + const Offset(-80, 0));
expect(tappedIndex, 3);
});

Expand Down

0 comments on commit ce9c3d6

Please sign in to comment.