Browse Source

test(jest): cleanup console warnings/errors (#6547)

bubble
Tim Lai 3 years ago
committed by GitHub
parent
commit
671e945376
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions
  1. +0
    -2
      test/components/response-body.jsx
  2. +5
    -3
      test/unit/components/models.jsx
  3. +2
    -1
      test/unit/components/primitive-model.jsx

+ 0
- 2
test/components/response-body.jsx View File

@@ -29,7 +29,6 @@ describe("<ResponseBody />", function() {
it("renders ResponseBody as 'image/svg'", function() {
props.contentType = "image/svg"
const wrapper = shallow(<ResponseBody {...props}/>)
console.warn(wrapper.debug())
expect(wrapper.find("highlightCodeComponent").length).toEqual(0)
})

@@ -37,7 +36,6 @@ describe("<ResponseBody />", function() {
props.contentType = "text/plain"
props.content = "test text"
const wrapper = shallow(<ResponseBody {...props}/>)
console.warn(wrapper.debug())
expect(wrapper.find("highlightCodeComponent[canCopy]").length).toEqual(1)
})
})

+ 5
- 3
test/unit/components/models.jsx View File

@@ -2,14 +2,16 @@ import React from "react"
import { shallow } from "enzyme"
import { fromJS, Map } from "immutable"
import Models from "components/models"
import ModelCollpase from "components/model-collapse"
import ModelCollapse from "components/model-collapse"
import ModelComponent from "components/model-wrapper"

describe("<Models/>", function(){
const dummyComponent = () => null
// Given
let components = {
Collapse: ModelCollpase,
ModelWrapper: ModelComponent
Collapse: ModelCollapse,
ModelWrapper: ModelComponent,
JumpToPath: dummyComponent,
}
let props = {
getComponent: (c) => {


+ 2
- 1
test/unit/components/primitive-model.jsx View File

@@ -8,7 +8,8 @@ describe("<PrimitiveModel/>", function () {
const dummyComponent = () => null
const components = {
Markdown: dummyComponent,
EnumModel: dummyComponent
EnumModel: dummyComponent,
Property: dummyComponent,
}
const props = {
getComponent: c => components[c],


Loading…
Cancel
Save