diff --git a/store/chat/mutations.test.ts b/store/chat/mutations.test.ts index a1fef629f2..71bf893cee 100644 --- a/store/chat/mutations.test.ts +++ b/store/chat/mutations.test.ts @@ -1046,4 +1046,61 @@ describe('misc', () => { size: 10, }) }) + + test('module.removeFile', () => { + const localState = { + ...InitialChatState, + files: { + file1: [ + { + file: 'path2', + url: 'string2', + nsfw: { + checking: false, + status: false, + }, + progress: 0, + }, + ], + }, + } + const argument = { address: 'file1', index: 0 } + + module.default.removeFile(localState, argument) + + expect(localState.files).toEqual({ file1: [] }) + }) + + test('module.setFileProgress', () => { + const localState = { + ...InitialChatState, + files: { + file1: [ + { + file: 'path2', + url: 'string2', + nsfw: { + checking: false, + status: false, + }, + progress: 0, + }, + ], + }, + } + const argument = { address: 'file1', index: 0, progress: 10 } + + module.default.setFileProgress(localState, argument) + + expect(localState.files).toEqual({ + file1: [ + { + file: 'path2', + nsfw: { checking: false, status: false }, + progress: 10, + url: 'string2', + }, + ], + }) + }) })