mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix(jest): replace mock with jest.spyOn
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
This commit is contained in:
parent
809631539e
commit
70ee8de0ab
2 changed files with 3 additions and 3 deletions
|
|
@ -161,8 +161,8 @@ describe('Delete action execute tests', () => {
|
|||
})
|
||||
|
||||
test('Delete fails', async () => {
|
||||
axios.delete = jest.fn(() => { throw new Error('Mock error') })
|
||||
logger.error = jest.fn()
|
||||
jest.spyOn(axios, 'delete').mockImplementation(() => { throw new Error('Mock error') })
|
||||
jest.spyOn(logger, 'error').mockImplementation(() => jest.fn())
|
||||
|
||||
const file = new File({
|
||||
id: 1,
|
||||
|
|
|
|||
|
|
@ -126,8 +126,8 @@ describe('Open sidebar action exec tests', () => {
|
|||
|
||||
test('Open sidebar fails', async () => {
|
||||
const openMock = jest.fn(() => { throw new Error('Mock error') })
|
||||
logger.error = jest.fn()
|
||||
window.OCA = { Files: { Sidebar: { open: openMock } } }
|
||||
jest.spyOn(logger, 'error').mockImplementation(() => jest.fn())
|
||||
|
||||
const file = new File({
|
||||
id: 1,
|
||||
|
|
|
|||
Loading…
Reference in a new issue