Skip to content

Commit

Permalink
feat(jest): 100% branch coverage for store/chat/mutations (#3252)
Browse files Browse the repository at this point in the history
  • Loading branch information
drepram authored May 20, 2022
1 parent 666e890 commit 5496d09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
2 changes: 2 additions & 0 deletions store/chat/__snapshots__/mutations.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`misc module.default.addFile with empty files array 1`] = `Array []`;

exports[`module.default.addFile 0 1`] = `undefined`;

exports[`module.default.addFile 1 1`] = `undefined`;
Expand Down
19 changes: 4 additions & 15 deletions store/chat/mutations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,22 +234,11 @@ describe('misc', () => {
module.default.addFile(state, obj)
expect(state.files[obj.address]).toEqual([obj.file])
})
test.skip('draft module.default.addFile with non-empty files array', () => {
const state = {
replies: object,
chatTexts: object2,
files: [
{
file: 'path_file_0',
nsfw: { checking: false, status: false },
url: 'string',
},
],
}
test('module.default.addFile with empty files array', () => {
const obj = {
file: {
file: 'path',
url: 'string',
file: 'path2',
url: 'string2',
nsfw: {
checking: false,
status: false,
Expand All @@ -258,7 +247,7 @@ describe('misc', () => {
address: 'address1',
}
module.default.addFile(state, obj)
expect(state.files[obj.address]).toEqual([obj.file])
expect(state.files).toMatchSnapshot()
})
test('module.default.setFiles', () => {
const state = { replies: object, chatTexts: object2, files: object3 }
Expand Down

0 comments on commit 5496d09

Please sign in to comment.