-
-
Notifications
You must be signed in to change notification settings - Fork 337
New test cases for contribute_exercise_test.dart #981
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
reworked tests with new testcases
|
@rolandgeider pull request is ready for review! |
|
@Oknarb258 one of the new tests is failing 😆 |
|
@rolandgeider i think that it was caused by the missing mock file, i uploaded it and maybe the test will run now in order |
|
probably, I also often forget to regenerate them |
# Conflicts: # test/exercises/contribute_exercise_test.mocks.dart
| /// - User profile with isTrustworthy = true | ||
| /// - Categories, muscles, equipment, and languages data | ||
| /// - All properties required by the 6-step stepper form | ||
| void setupVerifiedUser() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this called on every test? why not call it from within setUp?
In any case better call it something else, since it does a bit more than setting up a user 😄
| final l10n = AppLocalizations.of(context); | ||
|
|
||
| // Find the Next button (use .first since there are 6 steps with 6 Next buttons) | ||
| final nextButton = find.widgetWithText(ElevatedButton, l10n.next).first; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as a note to myself in the future, it's probably a good idea to add keys to navigation widgets so that they can be more robustly accessed in tests
| await tester.pumpAndSettle(); | ||
|
|
||
| // Verify that multi-line text was accepted and is displayed | ||
| expect(find.text('Chest Press\nFlat Bench Press'), findsOneWidget); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could also test here that the names are properly read into individual elements in the alternateNamesEn list
few new changes for user verification
newly generated file
Proposed Changes
Added comprehensive widget tests for the exercise contribution screen, covering form validation, stepper navigation, provider integration, submission flow, and access control for verified users. Improved test structure and localization handling for consistency across all steps.
Related Issue(s)
No related issue.
Please check that the PR fulfills these requirements
(run
dart format .)///).