Files
swagger-ui/test/unit/core/plugins/configs/actions.js
2024-04-25 16:02:15 +02:00

26 lines
592 B
JavaScript

import { downloadConfig } from "core/plugins/configs/actions"
describe("configs plugin - actions", () => {
describe("downloadConfig", () => {
it("should call the system fetch helper with a provided request", () => {
const fetchSpy = jest.fn(async () => {})
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)
})
})
})