@@ -1,7 +1,8 @@
|
||||
/* eslint-env mocha */
|
||||
import React from "react"
|
||||
import { fromJSOrdered } from "core/utils"
|
||||
import expect, { createSpy } from "expect"
|
||||
import sinon from "sinon"
|
||||
import expect from "expect"
|
||||
import { shallow } from "enzyme"
|
||||
import LiveResponse from "components/live-response"
|
||||
import ResponseBody from "components/response-body"
|
||||
@@ -50,8 +51,8 @@ describe("<LiveResponse/>", function () {
|
||||
duration: 50
|
||||
})
|
||||
|
||||
let mutatedRequestForSpy = createSpy().andReturn(mutatedRequest)
|
||||
let requestForSpy = createSpy().andReturn(request)
|
||||
let mutatedRequestForSpy = sinon.stub().returns(mutatedRequest)
|
||||
let requestForSpy = sinon.stub().returns(request)
|
||||
|
||||
let components = {
|
||||
RequestSnippets: RequestSnippets,
|
||||
@@ -76,8 +77,8 @@ describe("<LiveResponse/>", function () {
|
||||
let wrapper = shallow(<LiveResponse {...props} />)
|
||||
|
||||
// Then
|
||||
expect(mutatedRequestForSpy.calls.length).toEqual(test.expected.mutatedRequestForCalls)
|
||||
expect(requestForSpy.calls.length).toEqual(test.expected.requestForCalls)
|
||||
expect(mutatedRequestForSpy.callCount).toEqual(test.expected.mutatedRequestForCalls)
|
||||
expect(requestForSpy.callCount).toEqual(test.expected.requestForCalls)
|
||||
|
||||
const snippets = wrapper.find("RequestSnippets")
|
||||
expect(snippets.length).toEqual(1)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* eslint-env mocha */
|
||||
import React from "react"
|
||||
import expect, { createSpy } from "expect"
|
||||
import expect from "expect"
|
||||
import { mount } from "enzyme"
|
||||
import { fromJS, Map } from "immutable"
|
||||
import OnlineValidatorBadge from "components/online-validator-badge"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* eslint-env mocha */
|
||||
import React from "react"
|
||||
import expect, { createSpy } from "expect"
|
||||
import expect from "expect"
|
||||
import { mount } from "enzyme"
|
||||
import { fromJS, Map } from "immutable"
|
||||
import OnlineValidatorBadge from "components/online-validator-badge"
|
||||
@@ -26,7 +26,7 @@ describe("<OnlineValidatorBadge/> Anchor Target Safety", function () {
|
||||
"https://validator.swagger.io/validator/debug?url=swagger.json"
|
||||
)
|
||||
expect(anchor.props().target).toEqual("_blank")
|
||||
expect(anchor.props().rel || "").toInclude("noopener")
|
||||
expect(anchor.props().rel || "").toInclude("noreferrer")
|
||||
expect(anchor.props().rel || "").toContain("noopener")
|
||||
expect(anchor.props().rel || "").toContain("noreferrer")
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user