Skip to content

Commit

Permalink
refactor(add-zod): Englishify Tests
Browse files Browse the repository at this point in the history
Co-Authored-By: Carol Soliman <17387510+carsoli@users.noreply.github.com>
  • Loading branch information
FlorianWendelborn and carsoli committed Sep 23, 2021
1 parent 46c95b8 commit 4590f0a
Showing 1 changed file with 32 additions and 32 deletions.
64 changes: 32 additions & 32 deletions packages/kotti-ui/source/make-props.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ describe('array', () => {
const ARRAY_SUCCESS = [[], [0], [1], [13, 8, 5, 3, 2, 1]]
const ARRAY_FAILURE = [{}, true, false, 'string', [true], [{}], ['string']]

it('z.array(z.number())', () => {
it('generates vue prop for schema “z.array(z.number())', () => {
const schema = z.object({
prop: z.array(z.number()),
})
Expand All @@ -140,7 +140,7 @@ describe('array', () => {
expect(prop).not.toValidate(...ARRAY_FAILURE, null, undefined)
})

it('z.array(z.number()).nullable()', () => {
it('generates vue prop for schema “z.array(z.number()).nullable()', () => {
const schema = z.object({
prop: z.array(z.number()).nullable(),
})
Expand All @@ -152,7 +152,7 @@ describe('array', () => {
expect(prop).not.toValidate(...ARRAY_FAILURE, undefined)
})

it('z.array(z.number()).default()', () => {
it('generates vue prop for schema “z.array(z.number()).default()', () => {
const schema = z.object({
prop: z.array(z.number()).default(() => []),
})
Expand All @@ -165,7 +165,7 @@ describe('array', () => {
expect(prop).not.toValidate(...ARRAY_FAILURE, null)
})

it('z.array(z.number()).nullable().default()', () => {
it('generates vue prop for schema “z.array(z.number()).nullable().default()', () => {
const schema = z.object({
prop: z.array(z.number()).nullable().default(null),
})
Expand All @@ -184,7 +184,7 @@ describe('boolean', () => {
const BOOLEAN_SUCCESS = [true, false]
const BOOLEAN_FAILURE = ['true', 'false', 1, [], {}]

it('z.boolean()', () => {
it('generates vue prop for schema “z.boolean()', () => {
const schema = z.object({
prop: z.boolean(),
})
Expand All @@ -196,7 +196,7 @@ describe('boolean', () => {
expect(prop).not.toValidate(...BOOLEAN_FAILURE, null, undefined)
})

it('z.boolean().nullable()', () => {
it('generates vue prop for schema “z.boolean().nullable()', () => {
const schema = z.object({
prop: z.boolean().nullable(),
})
Expand All @@ -208,7 +208,7 @@ describe('boolean', () => {
expect(prop).not.toValidate(...BOOLEAN_FAILURE, undefined)
})

it('z.boolean().default()', () => {
it('generates vue prop for schema “z.boolean().default()', () => {
const schema = z.object({
prop: z.boolean().default(true),
})
Expand All @@ -220,7 +220,7 @@ describe('boolean', () => {
expect(prop).not.toValidate(...BOOLEAN_FAILURE, null)
})

it('z.boolean().nullable().default()', () => {
it('generates vue prop for schema “z.boolean().nullable().default()', () => {
const schema = z.object({
prop: z.boolean().nullable().default(null),
})
Expand All @@ -239,7 +239,7 @@ describe('function', () => {
const FUNCTION_SUCCESS = [() => null, () => undefined, () => 'test']
const FUNCTION_FAILURE = ['string', true]

it('z.function()', () => {
it('generates vue prop for schema “z.function()', () => {
const schema = z.object({
prop: z.function(),
})
Expand All @@ -251,7 +251,7 @@ describe('function', () => {
expect(prop).not.toValidate(...FUNCTION_FAILURE, null, undefined)
})

it('z.function().nullable()', () => {
it('generates vue prop for schema “z.function().nullable()', () => {
const schema = z.object({
prop: z.function().nullable(),
})
Expand All @@ -263,7 +263,7 @@ describe('function', () => {
expect(prop).not.toValidate(...FUNCTION_FAILURE, undefined)
})

it('z.function().default()', () => {
it('generates vue prop for schema “z.function().default()', () => {
const schema = z.object({
prop: z.function().default(() => undefined),
})
Expand All @@ -286,7 +286,7 @@ describe('function', () => {
expect(prop).not.toValidate(undefined)
})

it('z.function().nullable().default()', () => {
it('generates vue prop for schema “z.function().nullable().default()', () => {
const schema = z.object({
prop: z.function().nullable().default(null),
})
Expand All @@ -311,7 +311,7 @@ describe('nativeEnum', () => {
const ENUM_SUCCESS = [TestEnum.KEY_A, TestEnum.KEY_B, TestEnum.KEY_C]
const ENUM_FAILURE = ['VALUE_D', 'string', [], {}, false]

it('z.nativeEnum()', () => {
it('generates vue prop for schema “z.nativeEnum()', () => {
const schema = z.object({
prop: z.nativeEnum(TestEnum),
})
Expand All @@ -323,7 +323,7 @@ describe('nativeEnum', () => {
expect(prop).not.toValidate(...ENUM_FAILURE, null, undefined)
})

it('z.nativeEnum().nullable()', () => {
it('generates vue prop for schema “z.nativeEnum().nullable()', () => {
const schema = z.object({
prop: z.nativeEnum(TestEnum).nullable(),
})
Expand All @@ -335,7 +335,7 @@ describe('nativeEnum', () => {
expect(prop).not.toValidate(...ENUM_FAILURE, undefined)
})

it('z.nativeEnum().default()', () => {
it('generates vue prop for schema “z.nativeEnum().default()', () => {
const schema = z.object({
prop: z.nativeEnum(TestEnum).default(() => TestEnum.KEY_A),
})
Expand All @@ -348,7 +348,7 @@ describe('nativeEnum', () => {
expect(prop).not.toValidate(...ENUM_FAILURE, null)
})

it('z.nativeEnum().nullable().default()', () => {
it('generates vue prop for schema “z.nativeEnum().nullable().default()', () => {
const schema = z.object({
prop: z.nativeEnum(TestEnum).nullable().default(null),
})
Expand Down Expand Up @@ -380,7 +380,7 @@ describe('number', () => {

const NUMBER_FAILURE = [{}, [], 'string', false, Number.NaN]

it('z.number()', () => {
it('generates vue prop for schema “z.number()', () => {
const schema = z.object({
prop: z.number(),
})
Expand All @@ -392,7 +392,7 @@ describe('number', () => {
expect(prop).not.toValidate(...NUMBER_FAILURE, null, undefined)
})

it('z.number().nullable()', () => {
it('generates vue prop for schema “z.number().nullable()', () => {
const schema = z.object({
prop: z.number().nullable(),
})
Expand All @@ -404,7 +404,7 @@ describe('number', () => {
expect(prop).not.toValidate(...NUMBER_FAILURE, undefined)
})

it('z.number().default()', () => {
it('generates vue prop for schema “z.number().default()', () => {
const schema = z.object({
prop: z.number().default(1),
})
Expand All @@ -416,7 +416,7 @@ describe('number', () => {
expect(prop).not.toValidate(...NUMBER_FAILURE, null)
})

it('z.number().nullable().default()', () => {
it('generates vue prop for schema “z.number().nullable().default()', () => {
const schema = z.object({
prop: z.number().nullable().default(null),
})
Expand All @@ -440,7 +440,7 @@ describe('object', () => {

const OBJECT_FAILURE = [{ key: null }, {}, [], 'string']

it('z.object()', () => {
it('generates vue prop for schema “z.object()', () => {
const schema = z.object({
prop: z.object({ key: z.boolean() }),
})
Expand All @@ -452,7 +452,7 @@ describe('object', () => {
expect(prop).not.toValidate(...OBJECT_FAILURE, null, undefined)
})

it('z.object().nullable()', () => {
it('generates vue prop for schema “z.object().nullable()', () => {
const schema = z.object({
prop: z.object({ key: z.boolean() }).nullable(),
})
Expand All @@ -464,7 +464,7 @@ describe('object', () => {
expect(prop).not.toValidate(...OBJECT_FAILURE, undefined)
})

it('z.object().default()', () => {
it('generates vue prop for schema “z.object().default()', () => {
const schema = z.object({
prop: z.object({ key: z.boolean() }).default(() => ({ key: true })),
})
Expand All @@ -477,7 +477,7 @@ describe('object', () => {
expect(prop).not.toValidate(...OBJECT_FAILURE, null)
})

it('z.object().nullable().default()', () => {
it('generates vue prop for schema “z.object().nullable().default()', () => {
const schema = z.object({
prop: z.object({ key: z.boolean() }).nullable().default(null),
})
Expand All @@ -497,7 +497,7 @@ describe('string', () => {

const STRING_FAILURE = [[], {}, 0, 1]

it('z.string()', () => {
it('generates vue prop for schema “z.string()', () => {
const schema = z.object({
prop: z.string(),
})
Expand All @@ -509,7 +509,7 @@ describe('string', () => {
expect(prop).not.toValidate(...STRING_FAILURE, null, undefined)
})

it('z.string().nullable()', () => {
it('generates vue prop for schema “z.string().nullable()', () => {
const schema = z.object({
prop: z.string().nullable(),
})
Expand All @@ -521,7 +521,7 @@ describe('string', () => {
expect(prop).not.toValidate(...STRING_FAILURE, undefined)
})

it('z.string().default()', () => {
it('generates vue prop for schema “z.string().default()', () => {
const schema = z.object({
prop: z.string().default('test'),
})
Expand All @@ -533,7 +533,7 @@ describe('string', () => {
expect(prop).not.toValidate(...STRING_FAILURE, null)
})

it('z.string().nullable().default()', () => {
it('generates vue prop for schema “z.string().nullable().default()', () => {
const schema = z.object({
prop: z.string().nullable().default(null),
})
Expand All @@ -552,7 +552,7 @@ describe('union', () => {
const UNION_SUCCESS = [...NUMBER_SUCCESS, ...STRING_SUCCESS]
const UNION_FAILURE = [[], {}, true, false]

it('z.union()', () => {
it('generates vue prop for schema “z.union()', () => {
const schema = z.object({
prop: z.union([z.number(), z.string()]),
})
Expand All @@ -564,7 +564,7 @@ describe('union', () => {
expect(prop).not.toValidate(...UNION_FAILURE, null, undefined)
})

it('z.union().nullable()', () => {
it('generates vue prop for schema “z.union().nullable()', () => {
const schema = z.object({
prop: z.union([z.number(), z.string()]).nullable(),
})
Expand All @@ -576,7 +576,7 @@ describe('union', () => {
expect(prop).not.toValidate(...UNION_FAILURE, undefined)
})

it('z.union().default()', () => {
it('generates vue prop for schema “z.union().default()', () => {
const schema = z.object({
prop: z.union([z.number(), z.string()]).default('test'),
})
Expand All @@ -588,7 +588,7 @@ describe('union', () => {
expect(prop).not.toValidate(...UNION_FAILURE, null)
})

it('z.union().nullable().default()', () => {
it('generates vue prop for schema “z.union().nullable().default()', () => {
const schema = z.object({
prop: z.union([z.number(), z.string()]).nullable().default(null),
})
Expand Down

0 comments on commit 4590f0a

Please sign in to comment.