feat: Add or and template folder media matchers (#2071)

- For: #1748
This commit is contained in:
Dermot Duffy
2025-05-29 21:21:59 -07:00
committed by GitHub
parent c077f8bf70
commit dc63dcdab9
25 changed files with 502 additions and 145 deletions
+29 -2
View File
@@ -1,6 +1,9 @@
import { describe, expect, it } from 'vitest';
import { transformPathURLToPathArray } from '../../../src/config/schema/folders';
import { NonEmptyTuple } from 'type-fest';
import { describe, expect, it } from 'vitest';
import {
matcherSchema,
transformPathURLToPathArray,
} from '../../../src/config/schema/folders';
describe('transformURLToMediaSourceRoot', () => {
const prefixes: NonEmptyTuple<string>[] = [
@@ -65,3 +68,27 @@ describe('transformURLToMediaSourceRoot', () => {
});
});
});
describe('should lazy evaluate schemas', () => {
it('should lazy evaluate or matcher', () => {
expect(
matcherSchema.parse({
type: 'or',
matchers: [
{
type: 'title',
title: 'Test Title',
},
],
}),
).toEqual({
type: 'or',
matchers: [
{
type: 'title',
title: 'Test Title',
},
],
});
});
});