Skip to content

Commit

Permalink
Remove popup feedback when applying a token
Browse files Browse the repository at this point in the history
Removes the popup as well as the test that asserts its existence. The tests for the pro token field that already exist should be enough to test error functionality.
  • Loading branch information
ashuntu committed Nov 19, 2024
1 parent 043b405 commit 7c542e5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,6 @@ class SubscribeNowPage extends StatelessWidget {
ProTokenInputField(
onApply: (token) {
model.applyProToken(token).then(onSubscriptionUpdate);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
width: 400.0,
behavior: SnackBarBehavior.floating,
content: Text(
lang.applyingProToken(token.value),
),
),
);
},
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,35 +125,6 @@ void main() {
expect(called, isFalse);
});
});
testWidgets('feedback when applying token', (tester) async {
final model = MockSubscribeNowModel();
when(model.purchaseAllowed).thenReturn(true);
when(model.applyProToken(any)).thenAnswer((_) async {
return SubscriptionInfo()..ensureUser();
});
final app = buildApp(model, onSubscribeNoop);
await tester.pumpWidget(app);

// expands the collapsed input field group
final toggle = find.byIcon(ProTokenInputField.expandIcon);
await tester.tap(toggle);
await tester.pumpAndSettle();

// enters a good token value
final inputField = find.byType(TextField);
await tester.enterText(inputField, tks.good);
await tester.pump();

// submits the input.
final context = tester.element(find.byType(SubscribeNowPage));
final lang = AppLocalizations.of(context);
final button = find.text(lang.confirm);
await tester.tap(button);
await tester.pump();

// asserts that feedback is shown
expect(find.byType(SnackBar), findsOneWidget);
});

testWidgets('purchase status enum l10n', (tester) async {
final model = MockSubscribeNowModel();
Expand Down

0 comments on commit 7c542e5

Please sign in to comment.