Skip to content

A modern, self-hosted backup solution for secure, encrypted backups across local and cloud storage.

test: updates storage test case for s3 storage handling change

towfiqi6a1f74764a85
diff --git a/backend/__tests__/managers/BaseStorageManager.test.ts b/backend/__tests__/managers/BaseStorageManager.test.ts
index d5f1af9..d38f133 100644
--- a/backend/__tests__/managers/BaseStorageManager.test.ts
+++ b/backend/__tests__/managers/BaseStorageManager.test.ts
@@ -49,6 +49,7 @@ describe('BaseStorageManager', () => {
const result = await manager.createRemote('s3', 'test-remote', 'credentials', {
access_key: 'test-key',
secret_key: 'test-secret',
+ bucket: 'test-bucket',
});
expect(mockRunRcloneCommand).toHaveBeenCalledWith([
@@ -63,7 +64,7 @@ describe('BaseStorageManager', () => {
'--obscure',
'--non-interactive',
]);
- expect(mockRunRcloneCommand).toHaveBeenCalledWith(['lsd', 'test-remote:']);
+ expect(mockRunRcloneCommand).toHaveBeenCalledWith(['lsd', 'test-remote:test-bucket']);
expect(result).toEqual({
success: true,
result: 'Remote created successfully',
@@ -99,6 +100,7 @@ describe('BaseStorageManager', () => {
'credentials',
{
access_key: 'test-key',
+ bucket: 'test-bucket',
},
{
region: 'us-east-1',
@@ -171,6 +173,7 @@ describe('BaseStorageManager', () => {
const result = await manager.createRemote('s3', 'test-remote', 'credentials', {
access_key: 'test-key',
+ bucket: 'test-bucket',
});
expect(result).toEqual({
@@ -187,6 +190,7 @@ describe('BaseStorageManager', () => {
const result = await manager.createRemote('s3', 'test-remote', 'credentials', {
access_key: 'test-key',
+ bucket: 'test-bucket',
});
expect(mockRunRcloneCommand).toHaveBeenNthCalledWith(1, [
@@ -201,7 +205,7 @@ describe('BaseStorageManager', () => {
'--obscure',
'--non-interactive',
]);
- expect(mockRunRcloneCommand).toHaveBeenNthCalledWith(2, ['lsd', 'test-remote:']);
+ expect(mockRunRcloneCommand).toHaveBeenNthCalledWith(2, ['lsd', 'test-remote:test-bucket']);
expect(mockRunRcloneCommand).toHaveBeenNthCalledWith(3, ['config', 'delete', 'test-remote']);
expect(result).toEqual({
success: false,