-
Notifications
You must be signed in to change notification settings - Fork 7
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
Show Barcode Scan results (basic) #570
Conversation
}); | ||
|
||
it('should show modal when products not found', async () => { | ||
fetchProductsByQuery.mockReturnValue(Promise.resolve({ |
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.
You can simplify this by replacing .mockReturnValue(Promise.resolve({}))
with .mockResolvedValue({})
- same for the other occurrences.
] = subscribe.mock.calls; | ||
}); | ||
|
||
it('should initialize subscriptions', () => { |
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.
Could you please split the tests by adding two additional describe
blocks - one for each subscription.
fetchProductsByQuery.mockReturnValue(Promise.resolve({ | ||
totalProductCount: 0, | ||
})); | ||
showModal.mockImplementation(options => Promise.resolve(options)); |
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.
Why didn't you add the mock implementation to the mock creation - like you do it for the other mocks.
import { SCANNER_SUCCESS } from '../constants'; | ||
|
||
/** @type {Observable} */ | ||
export const scanSuccess$ = main$ |
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 discussed please rename scanSuccess$
to scanFinished$
.
Description
Show Barcode Scan results (basic)