Skip to content

Commit

Permalink
Fix: unit tests item
Browse files Browse the repository at this point in the history
  • Loading branch information
emielvanseveren committed Oct 27, 2024
1 parent f774746 commit 74b1bb0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 131 deletions.

This file was deleted.

68 changes: 26 additions & 42 deletions packages/web-main/src/routes/_auth/_global/-modules/testData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export const validSchemas: Test[] = [
type: 'array',
title: 'array field',
description: 'array field description',
default: ['brunkel', 'cata', 'emiel'],
default: ['hendrik', 'niek', 'emiel'],
items: {
type: 'string',
},
Expand All @@ -240,7 +240,7 @@ export const validSchemas: Test[] = [
name: 'array field',
type: InputType.array,
required: false,
default: ['brunkel', 'cata', 'emiel'],
default: ['hendrik', 'niek', 'emiel'],
description: 'array field description',
},
],
Expand All @@ -255,7 +255,7 @@ export const validSchemas: Test[] = [
type: 'array',
title: 'array field',
description: 'array field description',
default: ['brunkel', 'cata', 'emiel'],
default: ['hendrik', 'cata', 'emiel'],
items: {
type: 'string',
},
Expand All @@ -272,7 +272,7 @@ export const validSchemas: Test[] = [
name: 'array field',
type: InputType.array,
required: false,
default: ['brunkel', 'cata', 'emiel'],
default: ['hendrik', 'cata', 'emiel'],
uniqueItems: true,
minItems: 1,
maxItems: 10,
Expand All @@ -290,7 +290,7 @@ export const validSchemas: Test[] = [
type: 'string',
title: 'enumeration field',
description: 'enumeration field description',
enum: ['cata', 'brunkel', 'emiel'],
enum: ['cata', 'hendrik', 'emiel'],
},
},
required: [],
Expand All @@ -304,7 +304,7 @@ export const validSchemas: Test[] = [
multiple: false,
default: undefined,
description: 'enumeration field description',
values: ['cata', 'brunkel', 'emiel'],
values: ['cata', 'hendrik', 'emiel'],
},
],
},
Expand All @@ -322,7 +322,7 @@ export const validSchemas: Test[] = [
description: 'enumeration field description',
items: {
type: 'string',
enum: ['cata', 'brunkel', 'emiel'],
enum: ['cata', 'hendrik', 'emiel'],
},
},
},
Expand All @@ -337,7 +337,7 @@ export const validSchemas: Test[] = [
multiple: true,
default: undefined,
description: 'enumeration field description',
values: ['cata', 'brunkel', 'emiel'],
values: ['cata', 'hendrik', 'emiel'],
},
],
},
Expand Down Expand Up @@ -367,45 +367,29 @@ export const validSchemas: Test[] = [
],
},
{
name: 'item field',
name: 'item field (v2)',
schema: {
$schema: 'http://json-schema.org/draft-07/schema#',
type: 'object',
properties: {
'item field': {
'x-component': InputType.item,
type: 'string',
title: 'item field',
description: 'item field description',
},
},
required: [],
additionalProperties: false,
},
inputs: [
{
name: 'item field',
type: InputType.item,
description: 'item field description',
required: false,
multiple: false,
},
],
},
{
name: 'item field with multiple',
schema: {
$schema: 'http://json-schema.org/draft-07/schema#',
type: 'object',
properties: {
'item field': {
'x-component': InputType.item,
type: 'array',
title: 'item field',
type: 'object',
title: 'Item',
description: 'item field description',
uniqueItems: true,
items: {
type: 'string',
properties: {
item: {
type: 'string',
title: 'Item Name',
},
amount: {
type: 'number',
title: 'Amount',
},
quality: {
type: 'string',
title: 'Quality',
},
},
},
},
Expand All @@ -418,7 +402,7 @@ export const validSchemas: Test[] = [
type: InputType.item,
description: 'item field description',
required: false,
multiple: true,
multiple: false,
},
],
},
Expand Down Expand Up @@ -570,7 +554,7 @@ export const invalidSchemas: Test[] = [
type: 'array',
title: 'array field',
description: 'array field description',
default: ['brunkel', 'cata', 'emiel'],
default: ['hendrik', 'cata', 'emiel'],
items: {
type: 'number',
},
Expand Down

0 comments on commit 74b1bb0

Please sign in to comment.