diff options
author | Devlin Junker <devlin.junker@gmail.com> | 2022-12-03 16:48:05 -0800 |
---|---|---|
committer | Benjamin Brahmer <info@b-brahmer.de> | 2022-12-06 14:57:20 +0100 |
commit | c975b93a8e465faaa27c37a5862ff43bd54dbbed (patch) | |
tree | fe1480edac59e130c02ba75476ab393290e06152 /tests/javascript | |
parent | 4fb5426285e66146451486f3885638bfc4386fb1 (diff) |
clean
Signed-off-by: Devlin Junker <devlin.junker@gmail.com>
Diffstat (limited to 'tests/javascript')
-rw-r--r-- | tests/javascript/unit/store/feed.spec.ts | 5 | ||||
-rw-r--r-- | tests/javascript/unit/store/folder.spec.ts | 9 |
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/javascript/unit/store/feed.spec.ts b/tests/javascript/unit/store/feed.spec.ts index 94f45d42d..29df4b105 100644 --- a/tests/javascript/unit/store/feed.spec.ts +++ b/tests/javascript/unit/store/feed.spec.ts @@ -30,13 +30,13 @@ describe('feed.ts', () => { it('SET_FEEDS should add feeds to state', () => { const state = { feeds: [] as Feed[], folders: [] as any[] } as AppState let feeds = [] as Feed[] - mutations[FEED_MUTATION_TYPES.SET_FEEDS](state, feeds) + mutations[FEED_MUTATION_TYPES.SET_FEEDS](state, feeds) expect(state.feeds.length).toEqual(0) feeds = [{ title: 'test' }] as Feed[] - mutations[FEED_MUTATION_TYPES.SET_FEEDS](state, feeds) + mutations[FEED_MUTATION_TYPES.SET_FEEDS](state, feeds) expect(state.feeds.length).toEqual(1) expect(state.feeds[0]).toEqual(feeds[0]) }) @@ -46,7 +46,6 @@ describe('feed.ts', () => { const feeds = [{ title: 'test', folderId: 1, unreadCount: 2 }] as Feed[] mutations[FEED_MUTATION_TYPES.SET_FEEDS](state, feeds) - expect(state.feeds.length).toEqual(1) expect(state.feeds[0]).toEqual(feeds[0]) expect(state.folders[0].feeds[0]).toEqual(feeds[0]) diff --git a/tests/javascript/unit/store/folder.spec.ts b/tests/javascript/unit/store/folder.spec.ts index 0350bed34..68cc04da7 100644 --- a/tests/javascript/unit/store/folder.spec.ts +++ b/tests/javascript/unit/store/folder.spec.ts @@ -18,7 +18,6 @@ describe('folder.ts', () => { const commit = jest.fn() await (actions[FOLDER_ACTION_TYPES.FETCH_FOLDERS] as any)({ commit }) - expect(axios.get).toBeCalled() expect(commit).toBeCalled() }) @@ -28,6 +27,7 @@ describe('folder.ts', () => { const folder = {} as Folder const commit = jest.fn() + await actions[FOLDER_ACTION_TYPES.ADD_FOLDERS]({ commit }, { folder }) expect(axios.post).toBeCalled() expect(commit).toBeCalled() @@ -38,6 +38,7 @@ describe('folder.ts', () => { const folder = {} as Folder const commit = jest.fn() + await actions[FOLDER_ACTION_TYPES.DELETE_FOLDER]({ commit }, { folder }) expect(axios.delete).toBeCalled() expect(commit).toBeCalled() @@ -48,13 +49,13 @@ describe('folder.ts', () => { it('SET_FOLDERS should add the passed in folders to the state', () => { const state = { folders: [] as Folder[] } as AppState let folders = [] as Folder[] - (mutations[FOLDER_MUTATION_TYPES.SET_FOLDERS] as any)(state, folders) + (mutations[FOLDER_MUTATION_TYPES.SET_FOLDERS] as any)(state, folders) expect(state.folders.length).toEqual(0) folders = [{ name: 'test' }] as Folder[] - (mutations[FOLDER_MUTATION_TYPES.SET_FOLDERS] as any)(state, folders) + (mutations[FOLDER_MUTATION_TYPES.SET_FOLDERS] as any)(state, folders) expect(state.folders.length).toEqual(1) expect(state.folders[0]).toEqual(folders[0]) }) @@ -62,8 +63,8 @@ describe('folder.ts', () => { it('DELETE_FOLDER should remove the passed in folder from the state', () => { const state = { folders: [{ name: 'test' }] as Folder[] } as AppState const folders = [state.folders[0]] as Folder[] - (mutations[FOLDER_MUTATION_TYPES.DELETE_FOLDER] as any)(state, folders) + (mutations[FOLDER_MUTATION_TYPES.DELETE_FOLDER] as any)(state, folders) expect(state.folders.length).toEqual(0) }) }) |