feature: allowEmptyValue controls (#4788)

* add baseline tests

* coerce empty strings to null when updating parameter values

* add ParameterIncludeEmpty

* add redux management for empty parameter value inclusion state

* use name+in keying for state management instead of hash keying

* update new redux method usages to name+in keying

* coerce empty Immutable iterables in onChangeWrapper

* OAS3 tests & support

* add included empty parameters to requests before dispatching to Swagger Client

* make empty inclusion interface prettier

* add tests for #4587

* linter fixes

* check for truthy value before reaching into property
This commit is contained in:
kyle
2018-08-04 01:26:07 -07:00
committed by GitHub
parent dd3afdc456
commit 87296702c6
18 changed files with 1363 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
/* eslint-env mocha */
import expect, { createSpy } from "expect"
import { fromJS } from "immutable"
import { execute, executeRequest, changeParamByIdentity } from "corePlugins/spec/actions"
import { execute, executeRequest, changeParamByIdentity, updateEmptyParamInclusion } from "corePlugins/spec/actions"
describe("spec plugin - actions", function(){
@@ -207,4 +207,22 @@ describe("spec plugin - actions", function(){
})
})
})
describe("updateEmptyParamInclusion", function () {
it("should map its arguments to a payload", function () {
const pathMethod = ["/one", "get"]
const result = updateEmptyParamInclusion(pathMethod, "param", "query", true)
expect(result).toEqual({
type: "spec_update_empty_param_inclusion",
payload: {
pathMethod,
paramName: "param",
paramIn: "query",
includeEmptyValue: true
}
})
})
})
})