chore: backup service test

This commit is contained in:
Aman Harwara
2023-06-06 22:15:06 +05:30
parent 0e938c5596
commit 6e6402da81
2 changed files with 3 additions and 1 deletions

View File

@@ -48,6 +48,7 @@ describe('backup service', () => {
device = {} as jest.Mocked<FileBackupsDevice> device = {} as jest.Mocked<FileBackupsDevice>
device.getFileBackupReadToken = jest.fn() device.getFileBackupReadToken = jest.fn()
device.readNextChunk = jest.fn() device.readNextChunk = jest.fn()
device.joinPaths = jest.fn()
session = {} as jest.Mocked<SessionsClientInterface> session = {} as jest.Mocked<SessionsClientInterface>
@@ -84,6 +85,7 @@ describe('backup service', () => {
history, history,
internalEventBus, internalEventBus,
) )
backupService.getFilesBackupsLocation = jest.fn().mockReturnValue('/')
crypto.xchacha20StreamInitDecryptor = jest.fn().mockReturnValue({ crypto.xchacha20StreamInitDecryptor = jest.fn().mockReturnValue({
state: {}, state: {},

View File

@@ -463,7 +463,7 @@ export class FilesBackupService extends AbstractService implements BackupService
return 'failed' return 'failed'
} }
const fileBackupsLocation = await this.getFilesBackupsLocation() const fileBackupsLocation = this.getFilesBackupsLocation()
if (!fileBackupsLocation) { if (!fileBackupsLocation) {
return 'failed' return 'failed'