test(oas31): move test out of components (#10300)

Refs #10247
This commit is contained in:
Vladimír Gorej
2025-02-17 17:58:16 +01:00
committed by GitHub
parent dfa908d25a
commit a8fc30da95

View File

@@ -0,0 +1,16 @@
import { fromJS } from "immutable"
import { isOAS31 } from "core/plugins/oas31/fn"
const isOAS31Shorthand = (version) => isOAS31(fromJS({
openapi: version
}))
describe("isOAS31", function () {
it("should recognize valid OAS31 version values", function () {
expect(isOAS31Shorthand("3.1.0")).toEqual(true)
expect(isOAS31Shorthand("3.1.1")).toEqual(true)
expect(isOAS31Shorthand("3.1.12")).toEqual(true)
expect(isOAS31Shorthand("3.2.0")).toEqual(false)
expect(isOAS31Shorthand("3.0.0-rc0")).toEqual(false)
})
})