refactor: update S3StorageAdapter tests to use public URL for object retrieval
Some checks failed
Build and Test / run-test (20.x) (push) Failing after 1m41s
Some checks failed
Build and Test / run-test (20.x) (push) Failing after 1m41s
This commit is contained in:
@@ -1,15 +1,20 @@
|
||||
import {
|
||||
S3StorageAdapter,
|
||||
S3StorageConfig,
|
||||
} from '@/lib/storage/storage.adapter';
|
||||
import {
|
||||
DeleteObjectCommand,
|
||||
PutObjectCommand,
|
||||
S3Client,
|
||||
} from '@aws-sdk/client-s3';
|
||||
import { S3StorageAdapter, S3StorageConfig } from '@/lib/storage/storage.adapter';
|
||||
import { DeleteObjectCommand, PutObjectCommand, S3Client } from '@aws-sdk/client-s3';
|
||||
import * as presigner from '@aws-sdk/s3-request-presigner';
|
||||
import { mockClient } from 'aws-sdk-client-mock';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
jest.mock('@aws-sdk/s3-request-presigner');
|
||||
|
||||
describe('S3StorageAdapter', () => {
|
||||
@@ -23,6 +28,7 @@ describe('S3StorageAdapter', () => {
|
||||
region: 'us-east-1',
|
||||
accessKey: 'test-access-key',
|
||||
secretKey: 'test-secret-key',
|
||||
publicUrl: 'http://test.com',
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -44,7 +50,7 @@ describe('S3StorageAdapter', () => {
|
||||
|
||||
expect(result).toEqual({
|
||||
ok: true,
|
||||
value: `http://localhost:9000/test-bucket/${key}`,
|
||||
value: `http://test.com/${key}`,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -55,7 +61,7 @@ describe('S3StorageAdapter', () => {
|
||||
|
||||
expect(result).toEqual({
|
||||
ok: true,
|
||||
value: `http://localhost:9000/test-bucket/${key}`,
|
||||
value: `http://test.com/${key}`,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user