Files
swagger-ui/test/core/plugins/configs/actions.js
kyle 7049de6201 v3.14.0 (#4492)
* v3.14.0

* fix: simplify config fetch interceptor implementation

* add `loadRemoteConfig` flag to requests

* v3.14.0
2018-04-27 23:20:13 -07:00

28 lines
681 B
JavaScript

/* eslint-env mocha */
import expect, { createSpy } from "expect"
import { downloadConfig } from "corePlugins/configs/spec-actions"
describe("configs plugin - actions", () => {
describe("downloadConfig", () => {
it("should call the system fetch helper with a provided request", () => {
const fetchSpy = createSpy(async () => {}).andCallThrough()
const system = {
fn: {
fetch: fetchSpy
}
}
const req = {
url: "http://swagger.io/one",
requestInterceptor: a => a,
responseInterceptor: a => a,
}
downloadConfig(req)(system)
expect(fetchSpy).toHaveBeenCalledWith(req)
})
})
})