Skip to content

Commit

Permalink
Fix new linter issue, leading underscores in test files
Browse files Browse the repository at this point in the history
  • Loading branch information
jushutch committed Jan 24, 2023
1 parent 1703704 commit 0ebb843
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions test/swiping_card_deck_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void main() {

final cardDeck = getMockCards();

Future<void> _mountWidget(WidgetTester tester) async {
Future<void> mountWidget(WidgetTester tester) async {
SwipingCardDeck mockDeck = SwipingCardDeck(
cardDeck: cardDeck,
onDeckEmpty: () => debugPrint("Card deck empty"),
Expand All @@ -36,20 +36,20 @@ void main() {
}

testWidgets("SwipingCardDeck widget is created", (WidgetTester tester) async {
await _mountWidget(tester);
await mountWidget(tester);
Finder deckFinder = find.byType(SwipingCardDeck);
expect(deckFinder, findsOneWidget);
});

testWidgets("Only two cards are rendered", (WidgetTester tester) async {
await _mountWidget(tester);
await mountWidget(tester);
Finder cardFinder = find.byType(Card);
expect(cardFinder, findsNWidgets(2));
});

testWidgets("swipeLeft removes top card and runs callback",
(WidgetTester tester) async {
await _mountWidget(tester);
await mountWidget(tester);
Finder cardFinder = find.byType(Card);
expect(cardFinder, findsNWidgets(2));
expect(tester.widget(cardFinder.first) as Card, cardDeck[1]);
Expand All @@ -68,7 +68,7 @@ void main() {

testWidgets("swipeRight removes top card and runs callback",
(WidgetTester tester) async {
await _mountWidget(tester);
await mountWidget(tester);
Finder deckFinder = find.byType(SwipingCardDeck);
expect(deckFinder, findsOneWidget);
SwipingCardDeck deck = tester.widget(deckFinder);
Expand All @@ -86,7 +86,7 @@ void main() {

testWidgets("Callback function is ran when deck is empty",
(WidgetTester tester) async {
await _mountWidget(tester);
await mountWidget(tester);
Finder deckFinder = find.byType(SwipingCardDeck);
expect(deckFinder, findsOneWidget);
SwipingCardDeck deck = tester.widget(deckFinder);
Expand Down
14 changes: 7 additions & 7 deletions test/swiping_gesture_detector_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void main() {
return cardDeck;
}

Future<void> _mountWidget(WidgetTester tester) async {
Future<void> mountWidget(WidgetTester tester) async {
final List<Card> cardDeck = getMockCards();
SwipingGestureDetector mockDetector = SwipingGestureDetector(
cardDeck: cardDeck,
Expand All @@ -43,7 +43,7 @@ void main() {
));
}

Future<void> _mountDisabledWidget(WidgetTester tester) async {
Future<void> mountDisabledWidget(WidgetTester tester) async {
final List<Card> cardDeck = getMockCards();
SwipingGestureDetector mockDetector = SwipingGestureDetector(
cardDeck: cardDeck,
Expand All @@ -70,14 +70,14 @@ void main() {

testWidgets("SwipingGestureDetector widget is created",
(WidgetTester tester) async {
await _mountWidget(tester);
await mountWidget(tester);
Finder gestureFinder = find.byType(SwipingGestureDetector);
expect(gestureFinder, findsOneWidget);
});

testWidgets("Card is swiped at correct thresholds",
(WidgetTester tester) async {
await _mountWidget(tester);
await mountWidget(tester);
Finder gestureFinder = find.byType(SwipingGestureDetector);
expect(gestureFinder, findsOneWidget);
SwipingGestureDetector detector = tester.widget(gestureFinder);
Expand Down Expand Up @@ -107,7 +107,7 @@ void main() {
// NOTE: The Offset values for the drag gesture are rounded because
// the dragAlignment is converted from pixels to a percentage which
// is imprecise.
await _mountWidget(tester);
await mountWidget(tester);
Finder gestureFinder = find.byType(SwipingGestureDetector);
expect(gestureFinder, findsOneWidget);
SwipingGestureDetector detector = tester.widget(gestureFinder);
Expand Down Expand Up @@ -143,7 +143,7 @@ void main() {
(WidgetTester tester) async {
// NOTE: The fling velocity values are slightly generous due to the
// imprecision of the drag details velocity.
await _mountWidget(tester);
await mountWidget(tester);
Finder gestureFinder = find.byType(SwipingGestureDetector);
expect(gestureFinder, findsOneWidget);
SwipingGestureDetector detector = tester.widget(gestureFinder);
Expand Down Expand Up @@ -178,7 +178,7 @@ void main() {
(WidgetTester tester) async {
// NOTE: The fling velocity values are slightly generous due to the
// imprecision of the drag details velocity.
await _mountDisabledWidget(tester);
await mountDisabledWidget(tester);
Finder gestureFinder = find.byType(SwipingGestureDetector);
expect(gestureFinder, findsOneWidget);
SwipingGestureDetector detector = tester.widget(gestureFinder);
Expand Down

0 comments on commit 0ebb843

Please sign in to comment.