mirror of
https://github.com/Art051/immich.git
synced 2025-08-11 19:29:00 +00:00
fix(server): add missing avi mime types and add tests (#3001)
See https://github.com/immich-app/immich/pull/2952#pullrequestreview-1497194041 Fixes: #2975
This commit is contained in:
21
server/src/domain/domain.constant.spec.ts
Normal file
21
server/src/domain/domain.constant.spec.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { validMimeTypes } from './domain.constant';
|
||||
|
||||
describe('valid mime types', () => {
|
||||
it('should be a sorted list', () => {
|
||||
expect(validMimeTypes).toEqual(validMimeTypes.sort());
|
||||
});
|
||||
|
||||
it('should contain only unique values', () => {
|
||||
expect(validMimeTypes).toEqual([...new Set(validMimeTypes)]);
|
||||
});
|
||||
|
||||
it('should contain only image or video mime types', () => {
|
||||
expect(validMimeTypes).toEqual(
|
||||
validMimeTypes.filter((mimeType) => mimeType.startsWith('image/') || mimeType.startsWith('video/')),
|
||||
);
|
||||
});
|
||||
|
||||
it('should contain only lowercase mime types', () => {
|
||||
expect(validMimeTypes).toEqual(validMimeTypes.map((mimeType) => mimeType.toLowerCase()));
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user