immich
immich copied to clipboard
chore(server): fix ups for comments on #2945
Sorry for the extra hassle - this PR consists solely of changes that should have been in #2945 but which I didn't push to the right place in time. It just sorts the list of raw mime types and removes a large comment that is unnecessary. Thanks to @uhthomas for noticing.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
immich | ⬜️ Ignored (Inspect) | Jun 26, 2023 7:53pm |
Looks great @elliotclee, thanks! As @jrasm91 suggested, a test which verifies the order of this list would be much appreciated.
Can we add a jest test that asserts the mime type order is sorted?
I don't know how to write this type of test. If you point me to an example in immich I should be able to put together the logic OK. It will be a few days in any case - my electricity is getting disconnected tomorrow to allow for repairs.
Can we add a jest test that asserts the mime type order is sorted?
I don't know how to write this type of test. If you point me to an example in immich I should be able to put together the logic OK. It will be a few days in any case - my electricity is getting disconnected tomorrow to allow for repairs.
Add something like this in asset-upload.config.spec.ts
. You will need to export const validMimeTypes so it can be used in the test though.
// domain.constant.ts
export const validMimeTypes = [...]
// asset-upload.config.spec.ts
it('should be a sorted list', () => {
expect(validMimeTypes).toEqual([...validMimeTypes].sort());
});
On a related note, it might be good to add a few other checks like:
- there are no duplicates in the list
- They all start with image/* or video/*
- The values are all lower case
I've added the tests in #3001.
superseded by #3001