Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Vendor & Vendors Redux #86

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

Conversation

daviddyess
Copy link
Member

Adds Redux for flavor vendors

@daviddyess daviddyess requested a review from a team September 2, 2020 17:06
@codecov
Copy link

codecov bot commented Sep 2, 2020

Codecov Report

Merging #86 (289c287) into master (8c2f327) will increase coverage by 0.96%.
The diff coverage is 94.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #86      +/-   ##
==========================================
+ Coverage   77.95%   78.92%   +0.96%     
==========================================
  Files          88       94       +6     
  Lines        1692     1798     +106     
==========================================
+ Hits         1319     1419     +100     
- Misses        373      379       +6     
Impacted Files Coverage Δ
src/reducers/index.js 100.00% <ø> (ø)
src/sagas/index.js 100.00% <ø> (ø)
src/sagas/vendors.js 75.00% <75.00%> (ø)
src/sagas/vendor.js 94.91% <94.91%> (ø)
src/reducers/vendor.js 100.00% <100.00%> (ø)
src/reducers/vendors.js 100.00% <100.00%> (ø)
src/selectors/vendor.js 100.00% <100.00%> (ø)
src/selectors/vendors.js 100.00% <100.00%> (ø)
... and 4 more

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 8c2f327...0b079a6. Read the comment docs.

users
users,
vendor,
vendors
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a test that needs updating for this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Now that you mention it... it seems like there was a test for reducers' index, but it's not in the master branch.

});

it('reduces DELETE_VENDOR action', () => {
const action = actions.deleteVendor({});
Copy link
Contributor

Choose a reason for hiding this comment

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

This should test that the vendor is actually removed from the collection

} else if (result.error) {
throw result.error;
} else {
throw new Error('Failed to get vendor!');
Copy link
Contributor

Choose a reason for hiding this comment

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

The case where vendor.vendorId === vendorId probably shouldn't produce an error, but should be handled silently, since the data requested is already there... or maybe it should re-fetch it anyway, either way a little more thought is needed here.

}
}

function* updateVendorWorker({ details: { vendorId, name, slug, code } }) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be { vendor: { id, name, slug, code } } ? Trying to standardize the object structures a bit so we don't have to do so much transformation.

};

it('handles success in requestVendorsWorker', () => {
/* const gen = workers.requestVendorsWorker({ pager });
Copy link
Contributor

Choose a reason for hiding this comment

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

Commented out code

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants