Change test for fake extension that wont work (#1266)

This commit is contained in:
CaliBrain
2026-08-24 17:54:10 -04:00
committed by GitHub
parent 9bcf595111
commit a5595cf9f1
5 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -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', () => {
+1 -1
View File
@@ -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.
*/