feat: Automatic plaintext backup option in Preferences > Backups will backup your notes and tags into plaintext, unencrypted folders on your computer. In addition, automatic encrypted text backups preference management has moved from the top-level menu in the desktop app to Preferences > Backups. (#2322)
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
import { HistoryServiceInterface } from './../History/HistoryServiceInterface'
|
||||
import { PayloadManagerInterface } from './../Payloads/PayloadManagerInterface'
|
||||
import { StorageServiceInterface } from './../Storage/StorageServiceInterface'
|
||||
import { SessionsClientInterface } from './../Session/SessionsClientInterface'
|
||||
import { StatusServiceInterface } from './../Status/StatusServiceInterface'
|
||||
import { FilesBackupService } from './BackupService'
|
||||
import { PureCryptoInterface, StreamEncryptor } from '@standardnotes/sncrypto-common'
|
||||
@@ -20,6 +24,10 @@ describe('backup service', () => {
|
||||
let internalEventBus: InternalEventBusInterface
|
||||
let backupService: FilesBackupService
|
||||
let device: FileBackupsDevice
|
||||
let session: SessionsClientInterface
|
||||
let storage: StorageServiceInterface
|
||||
let payloads: PayloadManagerInterface
|
||||
let history: HistoryServiceInterface
|
||||
|
||||
beforeEach(() => {
|
||||
apiService = {} as jest.Mocked<ApiServiceInterface>
|
||||
@@ -41,6 +49,8 @@ describe('backup service', () => {
|
||||
device.getFileBackupReadToken = jest.fn()
|
||||
device.readNextChunk = jest.fn()
|
||||
|
||||
session = {} as jest.Mocked<SessionsClientInterface>
|
||||
|
||||
syncService = {} as jest.Mocked<SyncServiceInterface>
|
||||
syncService.sync = jest.fn()
|
||||
|
||||
@@ -55,7 +65,25 @@ describe('backup service', () => {
|
||||
internalEventBus = {} as jest.Mocked<InternalEventBusInterface>
|
||||
internalEventBus.publish = jest.fn()
|
||||
|
||||
backupService = new FilesBackupService(itemManager, apiService, encryptor, device, status, crypto, internalEventBus)
|
||||
payloads = {} as PayloadManagerInterface
|
||||
history = {} as HistoryServiceInterface
|
||||
|
||||
storage = {} as StorageServiceInterface
|
||||
storage.getValue = jest.fn().mockReturnValue('')
|
||||
|
||||
backupService = new FilesBackupService(
|
||||
itemManager,
|
||||
apiService,
|
||||
encryptor,
|
||||
device,
|
||||
status,
|
||||
crypto,
|
||||
storage,
|
||||
session,
|
||||
payloads,
|
||||
history,
|
||||
internalEventBus,
|
||||
)
|
||||
|
||||
crypto.xchacha20StreamInitDecryptor = jest.fn().mockReturnValue({
|
||||
state: {},
|
||||
|
||||
Reference in New Issue
Block a user