Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
})
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,
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,