mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 06:14:59 +00:00
code: validate,update,page (1 files)
This commit is contained in:
@@ -4,13 +4,19 @@ import { validatePageUpdate } from '../../../src/core/validation/validate-page-u
|
||||
describe('validatePageUpdate', () => {
|
||||
it.each([
|
||||
{ data: {}, expected: [], description: 'no updates' },
|
||||
{ data: { slug: 'Bad_Slug' }, expected: ['Invalid slug format'], description: 'invalid slug' },
|
||||
{
|
||||
data: { slug: 'Bad_Slug' },
|
||||
expected: ['Invalid slug format (lowercase alphanumeric, hyphen, slash, 1-255 chars)'],
|
||||
description: 'invalid slug',
|
||||
},
|
||||
{
|
||||
data: { title: '' },
|
||||
expected: ['Invalid title (must be 1-200 characters)'],
|
||||
expected: ['Invalid title (must be 1-255 characters)'],
|
||||
description: 'invalid title',
|
||||
},
|
||||
{ data: { level: 6 }, expected: ['Invalid level (must be 0-5)'], description: 'invalid level' },
|
||||
{ data: { level: 6 }, expected: ['Invalid level (must be 1-5)'], description: 'invalid level' },
|
||||
{ data: { layout: [] }, expected: ['Layout must be an object'], description: 'invalid layout' },
|
||||
{ data: { isActive: 'yes' as unknown as boolean }, expected: ['isActive must be a boolean'], description: 'invalid active' },
|
||||
{
|
||||
data: { slug: 'valid-slug', title: 'Valid title', level: 2 },
|
||||
expected: [],
|
||||
|
||||
Reference in New Issue
Block a user