collection runner tag updates

This commit is contained in:
lohit-bruno
2025-07-15 14:33:18 +05:30
parent 3803576aa4
commit 0e28c97f8f
32 changed files with 920 additions and 342 deletions

View File

@@ -310,8 +310,7 @@ const requestSchema = Yup.object({
.nullable(),
assertions: Yup.array().of(keyValueSchema).nullable(),
tests: Yup.string().nullable(),
docs: Yup.string().nullable(),
tags: Yup.array().of(Yup.string().matches(/^[\w-]+$/, 'tag must be alphanumeric'))
docs: Yup.string().nullable()
})
.noUnknown(true)
.strict();
@@ -356,6 +355,7 @@ const itemSchema = Yup.object({
type: Yup.string().oneOf(['http-request', 'graphql-request', 'folder', 'js']).required('type is required'),
seq: Yup.number().min(1),
name: Yup.string().min(1, 'name must be at least 1 character').required('name is required'),
tags: Yup.array().of(Yup.string().matches(/^[\w-]+$/, 'tag must be alphanumeric')),
request: requestSchema.when('type', {
is: (type) => ['http-request', 'graphql-request'].includes(type),
then: (schema) => schema.required('request is required when item-type is request')

View File

@@ -7,7 +7,8 @@ describe('Item Schema Validation', () => {
const item = {
uid: uuid(),
name: 'A Folder',
type: 'folder'
type: 'folder',
tags: ['smoke-test']
};
const isValid = await itemSchema.validate(item);

View File

@@ -9,7 +9,6 @@ describe('Request Schema Validation', () => {
method: 'GET',
headers: [],
params: [],
tags: ['smoke-test'],
body: {
mode: 'none'
}