mirror of
https://github.com/directus/directus.git
synced 2026-01-29 11:48:15 -05:00
21 lines
482 B
TypeScript
21 lines
482 B
TypeScript
import { isDynamicVariable } from '../../src/utils/is-dynamic-variable';
|
|
|
|
const tests: [string, boolean][] = [
|
|
['$NOW', true],
|
|
['$NOW(- 1 year)', true],
|
|
['test', false],
|
|
['$CUSTOM', false],
|
|
['$CURRENT_USER', true],
|
|
['$CURRENT_ROLE', true],
|
|
['$CURRENT_USER.role.name', true],
|
|
['$CURRENT_ROLE.users.id', true],
|
|
];
|
|
|
|
describe('is extension type', () => {
|
|
for (const [value, result] of tests) {
|
|
it(value, () => {
|
|
expect(isDynamicVariable(value)).toBe(result);
|
|
});
|
|
}
|
|
});
|