-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(jest): improve numerous store tests (#4641)
* feat(jest): lots of improvement on store * chore(jest): remove store/groups/actions because not needed * chore(npm): remove empty peer dependencies * chore(npm): remove all changes to package.json * chore(jest): remove unnecessary dependency on store/chat/mutations * feat(jest): add coverage for store/ui/actions * chore(jest): disabled test due to Iridium multiformats link issue * chore(jest): rename file
- Loading branch information
Showing
4 changed files
with
155 additions
and
20 deletions.
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) | ||
}) | ||
}) |