mirror of
https://github.com/calibrain/shelfmark.git
synced 2026-10-03 19:25:47 +01:00
Change test for fake extension that wont work (#1266)
This commit is contained in:
@@ -425,7 +425,7 @@ export const ReleaseCell = ({
|
||||
const primaryFormat = formats?.[0] || null;
|
||||
const additionalFormats = formats?.slice(1) || [];
|
||||
|
||||
// The indexer named a format Shelfmark can't process (e.g. MAM "[ENG / MP4]").
|
||||
// The indexer named a format Shelfmark can't process (e.g. MAM "[ENG / AVI]").
|
||||
// Downloading it would only fail post-processing, so warn instead of showing the
|
||||
// bare content-type icon that makes it look like any other result.
|
||||
const unrecognizedFormats = primaryFormat ? [] : getUnrecognizedReleaseFormats(release);
|
||||
|
||||
@@ -42,16 +42,16 @@ describe('releaseFormats.getReleaseFormats', () => {
|
||||
describe('releaseFormats.getUnrecognizedReleaseFormats', () => {
|
||||
it('returns normalized, deduplicated unrecognized formats from extra', () => {
|
||||
const release = buildRelease({
|
||||
extra: { unrecognized_formats: ['MP4', ' mp4 ', 'WEBM'] },
|
||||
extra: { unrecognized_formats: ['AVI', ' avi ', 'WEBM'] },
|
||||
});
|
||||
|
||||
expect(getUnrecognizedReleaseFormats(release)).toEqual(['mp4', 'webm']);
|
||||
expect(getUnrecognizedReleaseFormats(release)).toEqual(['avi', 'webm']);
|
||||
});
|
||||
|
||||
it('accepts a single string value', () => {
|
||||
const release = buildRelease({ extra: { unrecognized_formats: 'MP4' } });
|
||||
const release = buildRelease({ extra: { unrecognized_formats: 'AVI' } });
|
||||
|
||||
expect(getUnrecognizedReleaseFormats(release)).toEqual(['mp4']);
|
||||
expect(getUnrecognizedReleaseFormats(release)).toEqual(['avi']);
|
||||
});
|
||||
|
||||
it('returns an empty list when nothing was flagged', () => {
|
||||
|
||||
@@ -36,7 +36,7 @@ export function getReleaseFormats(release: Release): string[] {
|
||||
|
||||
/**
|
||||
* Format tokens the indexer declared but the backend could not map to a known
|
||||
* book/audiobook format (e.g. MyAnonamouse "[ENG / MP4]"). Such a release will
|
||||
* book/audiobook format (e.g. MyAnonamouse "[ENG / AVI]"). Such a release will
|
||||
* download but fail post-processing, so the UI warns instead of showing a bare
|
||||
* content-type icon.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user