mirror of
https://github.com/usebruno/bruno.git
synced 2025-01-23 14:18:41 +01:00
Merge pull request #455 from survivant/patch-1
typo in the error message
This commit is contained in:
commit
2ee6759282
@ -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')
|
||||
}),
|
||||
|
@ -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')
|
||||
}),
|
||||
|
@ -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')
|
||||
}),
|
||||
|
@ -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')
|
||||
}),
|
||||
|
@ -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')
|
||||
}),
|
||||
|
@ -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')
|
||||
}),
|
||||
|
@ -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'),
|
||||
|
@ -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')
|
||||
}),
|
||||
|
@ -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',
|
||||
|
@ -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',
|
||||
|
@ -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')
|
||||
|
@ -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')
|
||||
)
|
||||
]);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user