-
Notifications
You must be signed in to change notification settings - Fork 16
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(jest): improve numerous store tests #4641
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7222009
feat(jest): lots of improvement on store
drepram 8546172
chore(jest): remove store/groups/actions because not needed
drepram 0c4d775
chore(npm): remove empty peer dependencies
drepram ac68a71
chore(npm): remove all changes to package.json
drepram 156e19b
chore(jest): remove unnecessary dependency on store/chat/mutations
drepram 8aa929d
Merge branch 'drepram/improve-store' of https://github.com/Satellite-β¦
drepram 1b2a4a3
feat(jest): add coverage for store/ui/actions
drepram cb324d3
chore(jest): disabled test due to Iridium multiformats link issue
drepram 65991b2
chore(jest): rename file
drepram File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import module from './actions' | ||
|
||
describe('Test store/ui', () => { | ||
it('should set messages', () => { | ||
const commit = jest.fn() | ||
const argument = ['message 1', 'message 2'] | ||
|
||
module.setMessages({ commit }, argument) | ||
|
||
expect(commit).toHaveBeenCalled() | ||
expect(commit).toHaveBeenCalledWith(argument) | ||
}) | ||
|
||
it('should set isScrollOver', () => { | ||
const commit = jest.fn() | ||
const status = true | ||
|
||
module.setIsScrollOver({ commit }, status) | ||
|
||
expect(commit).toHaveBeenCalledWith(status) | ||
}) | ||
|
||
it('should set activeChannel', () => { | ||
const commit = jest.fn() | ||
const channel = { | ||
type: '', | ||
id: '123', | ||
name: 'John Doe', | ||
} | ||
|
||
module.setActiveChannel({ commit }, channel) | ||
|
||
expect(commit).toHaveBeenCalledWith(channel) | ||
}) | ||
|
||
it('should set isReacted', () => { | ||
const commit = jest.fn() | ||
const argument = false | ||
|
||
module.setIsReacted({ commit }, argument) | ||
|
||
expect(commit).toHaveBeenCalledWith(argument) | ||
}) | ||
}) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
this is a good technique to keep things readable, keep it up!