Skip to content
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

chore(authenticator): cherry-pick tests from main, add screen geometry tests #2455

Merged

Conversation

Jordan-Nelson
Copy link
Member

Issue #, if available:

Description of changes:

  • Cherry-pick 9b2387c from main
  • Update CognitoAuthStub for next branch
  • Add tests for different screen geometries (screen size, pixel ratio)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

* chore: add stubs for auth cognito and amplify

* test: refactor tests, add tests for new configs

* chore: regenerate golden files

* chore: update comment, fix accidential cmd f change

* chore: add license headers

* chore: make internal mocks private
@Jordan-Nelson Jordan-Nelson requested a review from a team as a code owner December 2, 2022 17:05
Copy link
Contributor

@dnys1 dnys1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

Comment on lines 135 to 136
binding.window.devicePixelRatioTestValue = ScreenGeometry.mobile.pixelRatio;
binding.window.physicalSizeTestValue = ScreenGeometry.mobile.size;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these needed if they get overridden below?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I had added it because I wasn't planning on adding ScreenGeometry as one of the dimensions for the theme tests, but changed my mind and added it. Updated.

@codecov-commenter
Copy link

codecov-commenter commented Dec 2, 2022

Codecov Report

Merging #2455 (3bd61fd) into next (bc57d1d) will increase coverage by 9.65%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             next    #2455      +/-   ##
==========================================
+ Coverage   39.24%   48.90%   +9.65%     
==========================================
  Files         107      107              
  Lines        6653     6654       +1     
==========================================
+ Hits         2611     3254     +643     
+ Misses       4042     3400     -642     
Flag Coverage Δ
android-unit-tests ∅ <ø> (∅)
flutter-unit-tests 37.80% <ø> (+11.96%) ⬆️
ios-unit-tests 95.32% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...thenticator/lib/src/state/authenticator_state.dart 8.01% <0.00%> (+1.26%) ⬆️
...lify_authenticator/lib/src/widgets/form_field.dart 48.00% <0.00%> (+4.00%) ⬆️
.../amplify_authenticator/lib/src/widgets/button.dart 40.42% <0.00%> (+4.96%) ⬆️
...mplify_authenticator/lib/src/state/auth_state.dart 29.41% <0.00%> (+5.88%) ⬆️
...or/lib/src/l10n/generated/input_localizations.dart 93.75% <0.00%> (+6.25%) ⬆️
...r/lib/src/l10n/generated/button_localizations.dart 93.75% <0.00%> (+6.25%) ⬆️
.../lib/src/l10n/generated/country_localizations.dart 81.25% <0.00%> (+6.25%) ⬆️
...r/lib/src/state/inherited_authenticator_state.dart 53.33% <0.00%> (+6.66%) ⬆️
...r/lib/src/mixins/authenticator_username_field.dart 62.22% <0.00%> (+6.66%) ⬆️
...ticator/lib/src/services/amplify_auth_service.dart 8.06% <0.00%> (+8.06%) ⬆️
... and 27 more

@Jordan-Nelson Jordan-Nelson merged commit 6a5091c into aws-amplify:next Dec 2, 2022
@Jordan-Nelson Jordan-Nelson deleted the chore/cherry-pick-config-tests branch December 2, 2022 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants