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

Feature: getAll count fix #41

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Feature: getAll count fix #41

wants to merge 4 commits into from

Conversation

JuraJuki
Copy link
Contributor

@JuraJuki JuraJuki requested a review from renatoruk August 25, 2020 11:54
@renatoruk
Copy link
Contributor

Best way to test this is to write tests :)

@JuraJuki
Copy link
Contributor Author

JuraJuki commented Sep 9, 2020

2 issues in here.
First, the dataMeta returned in the meta is undefined. Therefore the count, total or totalItems cannot be extracted from it from it
Second, issue with the usePrevious causing an error of hooks order change. Fixable by returning usePrevious(prevCount) instead of returning the prevCount (fixed via commit)

@renatoruk
Copy link
Contributor

2 issues in here.
First, the dataMeta returned in the meta is undefined. Therefore the count, total or totalItems cannot be extracted from it from it
Second, issue with the usePrevious causing an error of hooks order change. Fixable by returning usePrevious(prevCount) instead of returning the prevCount (fixed via commit)

Can you point to a specific test file or something where I can take a look?

@JuraJuki
Copy link
Contributor Author

2 issues in here.
First, the dataMeta returned in the meta is undefined. Therefore the count, total or totalItems cannot be extracted from it from it
Second, issue with the usePrevious causing an error of hooks order change. Fixable by returning usePrevious(prevCount) instead of returning the prevCount (fixed via commit)

Can you point to a specific test file or something where I can take a look?

This is the file pointing to the count fix: https://github.com/bornfight/aardvark/pull/41/files#diff-d06e6acc955a1369df2be73e89770b53

But the fix doesn't work because the returned meta is undefined, so it cannot read the count from it. I believe that #38 must be fixed and merged before we can continue on this PR

@codecov
Copy link

codecov bot commented Sep 16, 2020

Codecov Report

Merging #41 into master will decrease coverage by 0.28%.
The diff coverage is 40.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #41      +/-   ##
==========================================
- Coverage   85.41%   85.13%   -0.29%     
==========================================
  Files          49       50       +1     
  Lines        1049     1056       +7     
  Branches      161      161              
==========================================
+ Hits          896      899       +3     
- Misses        151      155       +4     
  Partials        2        2              
Impacted Files Coverage Δ
src/hooks/usePrevious.ts 33.33% <33.33%> (ø)
src/selectors/apiSelectors.ts 63.04% <50.00%> (+0.82%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0955069...407e8ac. Read the comment docs.

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