fix typo and use singular

This commit is contained in:
Sebastien Dionne 2023-10-07 15:54:33 -04:00
parent 515381b930
commit 0179c58cd2
2 changed files with 3 additions and 3 deletions

View File

@ -123,7 +123,7 @@ const itemSchema = Yup.object({
uid: uidSchema, uid: uidSchema,
type: Yup.string().oneOf(['http-request', 'graphql-request', 'folder']).required('type is required'), type: Yup.string().oneOf(['http-request', 'graphql-request', 'folder']).required('type is required'),
seq: Yup.number().min(1), seq: Yup.number().min(1),
name: Yup.string().min(1, 'name must be atleast 1 characters').required('name is required'), name: Yup.string().min(1, 'name must be at least 1 character').required('name is required'),
request: requestSchema.when('type', { request: requestSchema.when('type', {
is: (type) => ['http-request', 'graphql-request'].includes(type), is: (type) => ['http-request', 'graphql-request'].includes(type),
then: (schema) => schema.required('request is required when item-type is request') then: (schema) => schema.required('request is required when item-type is request')
@ -138,7 +138,7 @@ const itemSchema = Yup.object({
const collectionSchema = Yup.object({ const collectionSchema = Yup.object({
version: Yup.string().oneOf(['1']).required('version is required'), version: Yup.string().oneOf(['1']).required('version is required'),
uid: uidSchema, uid: uidSchema,
name: Yup.string().min(1, 'name must be atleast 1 characters').required('name is required'), name: Yup.string().min(1, 'name must be at least 1 character').required('name is required'),
items: Yup.array().of(itemSchema), items: Yup.array().of(itemSchema),
activeEnvironmentUid: Yup.string() activeEnvironmentUid: Yup.string()
.length(21, 'activeEnvironmentUid must be 21 characters in length') .length(21, 'activeEnvironmentUid must be 21 characters in length')

View File

@ -34,7 +34,7 @@ describe('Item Schema Validation', () => {
return Promise.all([ return Promise.all([
expect(itemSchema.validate(item)).rejects.toEqual( expect(itemSchema.validate(item)).rejects.toEqual(
validationErrorWithMessages('name must be atleast 1 characters') validationErrorWithMessages('name must be at least 1 character')
) )
]); ]);
}); });