ft: JsonSchema components are now ImmutableJS compliant (#5952)

bug: JsonSchema components should validate schema properties exists
  - schema
  - type
  - format
  - enum
bug: fix a debounce error in JsonSchema_string if value is null
ft: new simplified JsonSchemaArrayItemText component
test: use immutableJS for `json-schema-form` test
test: add dev scripts to run `cypress open`
test: new cypress `schema-form` tests
This commit is contained in:
Tim Lai
2020-05-06 13:57:58 -07:00
committed by GitHub
parent b38203e21a
commit 5eb23cdd48
9 changed files with 1508 additions and 113 deletions

View File

@@ -1,6 +1,6 @@
/* eslint-env mocha */
import React from "react"
import { List } from "immutable"
import Immutable, { List } from "immutable"
import expect, { createSpy } from "expect"
import { Select, Input, TextArea } from "components/layout-utils"
import { mount, render } from "enzyme"
@@ -25,10 +25,10 @@ describe("<JsonSchemaForm/>", function(){
onChange: () => {},
keyName: "",
fn: {},
schema: {
schema: Immutable.fromJS({
type: "string",
enum: ["one", "two"]
}
})
}
let wrapper = render(<JsonSchemaForm {...props}/>)
@@ -48,10 +48,10 @@ describe("<JsonSchemaForm/>", function(){
onChange: () => {},
keyName: "",
fn: {},
schema: {
schema: Immutable.fromJS({
type: "string",
enum: ["one", "two"]
},
}),
disabled: true
}
@@ -70,10 +70,10 @@ describe("<JsonSchemaForm/>", function(){
keyName: "",
fn: {},
required: true,
schema: {
schema: Immutable.fromJS({
type: "string",
enum: ["one", "two"]
}
})
}
let wrapper = render(<JsonSchemaForm {...props}/>)
@@ -93,9 +93,9 @@ describe("<JsonSchemaForm/>", function(){
onChange: () => {},
keyName: "",
fn: {},
schema: {
schema: Immutable.fromJS({
type: "boolean"
}
})
}
let wrapper = render(<JsonSchemaForm {...props}/>)
@@ -116,10 +116,10 @@ describe("<JsonSchemaForm/>", function(){
onChange: () => {},
keyName: "",
fn: {},
schema: {
schema: Immutable.fromJS({
type: "boolean",
enum: ["true"]
}
})
}
let wrapper = render(<JsonSchemaForm {...props}/>)
@@ -139,10 +139,10 @@ describe("<JsonSchemaForm/>", function(){
onChange: () => {},
keyName: "",
fn: {},
schema: {
schema: Immutable.fromJS({
type: "boolean",
required: true
}
})
}
let wrapper = render(<JsonSchemaForm {...props}/>)
@@ -164,10 +164,10 @@ describe("<JsonSchemaForm/>", function(){
keyName: "",
fn: {},
required: true,
schema: {
schema: Immutable.fromJS({
type: "boolean",
enum: ["true"]
}
})
}
let wrapper = render(<JsonSchemaForm {...props}/>)
@@ -191,7 +191,7 @@ describe("<JsonSchemaForm/>", function(){
keyName: "",
fn: {},
errors: List(),
schema: {
schema: Immutable.fromJS({
type: "object",
properties: {
id: {
@@ -199,7 +199,7 @@ describe("<JsonSchemaForm/>", function(){
example: "abc123"
}
}
}
})
}
let wrapper = mount(<JsonSchemaForm {...props}/>)
@@ -219,9 +219,9 @@ describe("<JsonSchemaForm/>", function(){
onChange: () => {},
keyName: "",
fn: {},
schema: {
schema: Immutable.fromJS({
type: "NotARealType"
}
})
}
@@ -240,10 +240,10 @@ describe("<JsonSchemaForm/>", function(){
onChange: () => {},
keyName: "",
fn: {},
schema: {
schema: Immutable.fromJS({
type: "NotARealType",
format: "NotARealFormat"
}
})
}