Skip to content

Commit

Permalink
fix: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cieslarmichal committed Sep 1, 2024
1 parent ad48edf commit 155c6e5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('FindUserBucketsQueryHandler', () => {

let s3TestUtils: S3TestUtils;

const bucketName = 'bucketName';
const bucketName = 'existing-bucket-name';

beforeEach(async () => {
const container = TestContainer.create();
Expand Down Expand Up @@ -56,14 +56,14 @@ describe('FindUserBucketsQueryHandler', () => {
it('returns no buckets when UserBucket exists but bucket does not exist in S3', async () => {
const user = await userTestUtils.createAndPersist();

const userBucket = await userBucketTestUtils.createAndPersist({ input: { userId: user.id } });
await userBucketTestUtils.createAndPersist({ input: { userId: user.id } });

const { buckets } = await findUserBucketsQueryHandler.execute({ userId: user.id });

expect(buckets).toEqual([{ name: userBucket.bucketName }]);
expect(buckets).toEqual([]);
});

it('returns UserBucket when UserBucket exists and bucketalso exists in S3', async () => {
it('returns UserBucket when UserBucket exists and bucket also exists in S3', async () => {
const user = await userTestUtils.createAndPersist();

const userBucket = await userBucketTestUtils.createAndPersist({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ interface CreateResourceModalProps {
bucketName: string;
}

const MAX_FILE_SIZE = Number(import.meta.env['VITE_MAX_FILE_SIZE']);
const DEFAULT_MAX_FILE_SIZE = 3865470566;

const MAX_FILE_SIZE = Number(import.meta.env['VITE_MAX_FILE_SIZE']) || DEFAULT_MAX_FILE_SIZE;

const acceptedImageAndVideoFormats =
'audio/,video/quicktime,video/x-msvideo,video/x-ms-wmv,.jpg,.jpeg,.tiff,.webp,.raw,.png,.mp4,.mov,.avi,.mkv,.wmv,.flv,.webm,.mpeg,.mpg,.3gp,.ogg,.ts,.m4v,.m2ts,.vob,.rm,.rmvb,.divx,.asf,.swf,.f4v' as string;
Expand Down

0 comments on commit 155c6e5

Please sign in to comment.