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

feat(neon_framework): add account_repository #2403

Merged
merged 4 commits into from
Aug 19, 2024

Conversation

Leptopoda
Copy link
Member

Finally a end to end unit tested login flow.

  1. I did not add a separate conventional commit type for the account_repository. As it is mostly going to be used by the framework itself, I feel like neon_framework is good enough. I don't want too many types (open for discussions)
  2. This is still a draft, as I was not able to get all tests to pass. Especially the widget tests of all pages have issues with the widget finder. I have no idea what is causing this and will continue to look into it.

@Leptopoda Leptopoda changed the title refactor(neon_framework): move find account by id into the accounts bloc refactor(neon_framework): rewrite login flow and account handling Aug 16, 2024
@Leptopoda Leptopoda marked this pull request as draft August 16, 2024 19:35
Copy link
Member

@provokateurin provokateurin left a comment

Choose a reason for hiding this comment

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

I only reviewed the account_repository so far.
I'll review the neon_framework changes when the existing comments have been sorted out.
IMO you should add a verify for all the API calls that are made in the tests.

@Leptopoda Leptopoda force-pushed the feat/neon_framework/account_repository branch from d14008c to 97eb9bd Compare August 17, 2024 11:30
@Leptopoda Leptopoda changed the title refactor(neon_framework): rewrite login flow and account handling feat(neon_framework): add account_repository Aug 17, 2024
@Leptopoda
Copy link
Member Author

I've dropped the neon_framework changes for easier reviewability.

@Leptopoda Leptopoda force-pushed the feat/neon_framework/account_repository branch from 97eb9bd to 4b0bf6d Compare August 18, 2024 06:10
@Leptopoda
Copy link
Member Author

IMO you should add a verify for all the API calls that are made in the tests.

Thanks for mentioning. I've added them everywhere.

@Leptopoda Leptopoda force-pushed the feat/neon_framework/account_repository branch 2 times, most recently from 05efad7 to ceffbdc Compare August 18, 2024 06:14
@Leptopoda Leptopoda force-pushed the feat/neon_framework/account_repository branch 4 times, most recently from 7c65257 to 750e590 Compare August 18, 2024 20:23
@Leptopoda
Copy link
Member Author

Please review my latest changes.
I added a testing library so our createModel can be reused by other tests

Copy link
Member

@provokateurin provokateurin left a comment

Choose a reason for hiding this comment

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

In many places you are using await expectLater(), but it is unnecessary because you already match using completion().

@Leptopoda Leptopoda force-pushed the feat/neon_framework/account_repository branch from 750e590 to b120fc3 Compare August 19, 2024 06:35
@Leptopoda Leptopoda marked this pull request as ready for review August 19, 2024 06:35
Signed-off-by: Nikolas Rimikis <leptopoda@users.noreply.github.com>
Future code refactors will access individual clients directly so the
script can no longer check them.

Signed-off-by: Nikolas Rimikis <leptopoda@users.noreply.github.com>
Signed-off-by: Nikolas Rimikis <leptopoda@users.noreply.github.com>
@Leptopoda Leptopoda force-pushed the feat/neon_framework/account_repository branch from b120fc3 to 61963b5 Compare August 19, 2024 06:58
@Leptopoda
Copy link
Member Author

Leptopoda commented Aug 19, 2024

In many places you are using await expectLater(), but it is unnecessary because you already match using completion().

No this will not work as the verify calls would be invoked before the actual call completes.

For the [completes] and [completion] matchers, as well as [throwsA] and related matchers when they're matched against a [Future], the returned future completes when the matched future completes.

@provokateurin
Copy link
Member

Oh but then there are some places were you use completion() without await expectLater()

Copy link

codecov bot commented Aug 19, 2024

Codecov Report

Attention: Patch coverage is 98.93238% with 3 lines in your changes missing coverage. Please review.

Project coverage is 26.40%. Comparing base (5bd82e1) to head (be66e4b).
Report is 6 commits behind head on main.

Files Patch % Lines
...ackages/neon_framework/lib/src/blocs/accounts.dart 0.00% 2 Missing ⚠️
...nt_repository/lib/src/testing/testing_account.dart 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2403      +/-   ##
==========================================
+ Coverage   26.32%   26.40%   +0.08%     
==========================================
  Files         362      370       +8     
  Lines      136541   136662     +121     
==========================================
+ Hits        35940    36086     +146     
+ Misses     100601   100576      -25     
Flag Coverage Δ *Carryforward flag
account_repository 99.64% <99.64%> (?)
cookie_store 100.00% <ø> (ø) Carriedforward from 5bd82e1
dashboard_app 96.05% <ø> (ø)
dynamite 31.08% <ø> (ø) Carriedforward from 5bd82e1
dynamite_end_to_end_test 61.84% <ø> (ø) Carriedforward from 5bd82e1
dynamite_runtime 85.40% <ø> (ø) Carriedforward from 5bd82e1
neon_dashboard 96.05% <ø> (ø) Carriedforward from 5bd82e1
neon_framework 43.56% <33.33%> (-1.76%) ⬇️
neon_http_client 93.28% <ø> (ø) Carriedforward from 5bd82e1
neon_notifications 100.00% <ø> (ø) Carriedforward from 5bd82e1
neon_talk 99.45% <ø> (ø) Carriedforward from 5bd82e1
nextcloud 22.34% <ø> (ø) Carriedforward from 5bd82e1
notifications_app 100.00% <ø> (ø)
sort_box 90.90% <ø> (ø) Carriedforward from 5bd82e1
talk_app 99.09% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

Files Coverage Δ
...lib/src/settings/utils/settings_export_helper.dart 100.00% <100.00%> (ø)
...account_repository/lib/src/account_repository.dart 100.00% <100.00%> (ø)
...es/account_repository/lib/src/account_storage.dart 100.00% <100.00%> (ø)
...account_repository/lib/src/models/credentials.dart 100.00% <100.00%> (ø)
...count_repository/lib/src/models/credentials.g.dart 100.00% <100.00%> (ø)
...count_repository/lib/src/models/login_qr_code.dart 100.00% <100.00%> (ø)
...account_repository/lib/src/models/serializers.dart 100.00% <100.00%> (ø)
...epository/lib/src/testing/testing_credentials.dart 100.00% <100.00%> (ø)
...epository/lib/src/utils/authentication_client.dart 100.00% <100.00%> (ø)
..._repository/lib/src/utils/http_client_builder.dart 100.00% <100.00%> (ø)
... and 2 more

... and 2 files with indirect coverage changes

Signed-off-by: Nikolas Rimikis <leptopoda@users.noreply.github.com>
@Leptopoda Leptopoda force-pushed the feat/neon_framework/account_repository branch from 61963b5 to be66e4b Compare August 19, 2024 07:19
@Leptopoda Leptopoda merged commit 4228e92 into main Aug 19, 2024
10 checks passed
@Leptopoda Leptopoda deleted the feat/neon_framework/account_repository branch August 19, 2024 08:06
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.

2 participants