Merge pull request #455 from survivant/patch-1

typo in the error message
This commit is contained in:
Anoop M D 2023-10-08 04:10:58 +05:30 committed by GitHub
commit 2ee6759282
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 14 additions and 14 deletions

View File

@ -17,7 +17,7 @@ const CopyEnvironment = ({ collection, environment, onClose }) => {
},
validationSchema: Yup.object({
name: Yup.string()
.min(1, 'must be atleast 1 characters')
.min(1, 'must be at least 1 character')
.max(50, 'must be 50 characters or less')
.required('name is required')
}),

View File

@ -17,7 +17,7 @@ const CreateEnvironment = ({ collection, onClose }) => {
},
validationSchema: Yup.object({
name: Yup.string()
.min(1, 'must be atleast 1 characters')
.min(1, 'must be at least 1 character')
.max(50, 'must be 50 characters or less')
.required('name is required')
}),

View File

@ -17,7 +17,7 @@ const RenameEnvironment = ({ onClose, environment, collection }) => {
},
validationSchema: Yup.object({
name: Yup.string()
.min(1, 'must be atleast 1 characters')
.min(1, 'must be at least 1 character')
.max(50, 'must be 50 characters or less')
.required('name is required')
}),

View File

@ -18,7 +18,7 @@ const CloneCollectionItem = ({ collection, item, onClose }) => {
},
validationSchema: Yup.object({
name: Yup.string()
.min(1, 'must be atleast 1 characters')
.min(1, 'must be at least 1 character')
.max(50, 'must be 50 characters or less')
.required('name is required')
}),

View File

@ -17,7 +17,7 @@ const RenameCollectionItem = ({ collection, item, onClose }) => {
},
validationSchema: Yup.object({
name: Yup.string()
.min(1, 'must be atleast 1 characters')
.min(1, 'must be at least 1 character')
.max(50, 'must be 50 characters or less')
.required('name is required')
}),

View File

@ -16,7 +16,7 @@ const RenameCollection = ({ collection, onClose }) => {
},
validationSchema: Yup.object({
name: Yup.string()
.min(1, 'must be atleast 1 characters')
.min(1, 'must be at least 1 character')
.max(50, 'must be 50 characters or less')
.required('name is required')
}),

View File

@ -21,11 +21,11 @@ const CreateCollection = ({ onClose }) => {
},
validationSchema: Yup.object({
collectionName: Yup.string()
.min(1, 'must be atleast 1 characters')
.min(1, 'must be at least 1 character')
.max(50, 'must be 50 characters or less')
.required('collection name is required'),
collectionFolderName: Yup.string()
.min(1, 'must be atleast 1 characters')
.min(1, 'must be at least 1 character')
.max(50, 'must be 50 characters or less')
.matches(/^[\w\-. ]+$/, 'Folder name contains invalid characters')
.required('folder name is required'),

View File

@ -16,7 +16,7 @@ const ImportCollectionLocation = ({ onClose, handleSubmit, collectionName }) =>
},
validationSchema: Yup.object({
collectionLocation: Yup.string()
.min(1, 'must be atleast 1 characters')
.min(1, 'must be at least 1 character')
.max(500, 'must be 500 characters or less')
.required('name is required')
}),

View File

@ -16,7 +16,7 @@ const NewFolder = ({ collection, item, onClose }) => {
},
validationSchema: Yup.object({
folderName: Yup.string()
.min(1, 'must be atleast 1 characters')
.min(1, 'must be at least 1 character')
.required('name is required')
.test({
name: 'folderName',

View File

@ -25,7 +25,7 @@ const NewRequest = ({ collection, item, isEphemeral, onClose }) => {
},
validationSchema: Yup.object({
requestName: Yup.string()
.min(1, 'must be atleast 1 characters')
.min(1, 'must be at least 1 character')
.required('name is required')
.test({
name: 'requestName',

View File

@ -123,7 +123,7 @@ const itemSchema = Yup.object({
uid: uidSchema,
type: Yup.string().oneOf(['http-request', 'graphql-request', 'folder']).required('type is required'),
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', {
is: (type) => ['http-request', 'graphql-request'].includes(type),
then: (schema) => schema.required('request is required when item-type is request')
@ -138,7 +138,7 @@ const itemSchema = Yup.object({
const collectionSchema = Yup.object({
version: Yup.string().oneOf(['1']).required('version is required'),
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),
activeEnvironmentUid: Yup.string()
.length(21, 'activeEnvironmentUid must be 21 characters in length')

View File

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