Move method filtering logic to Operations component
This commit is contained in:
@@ -11,12 +11,14 @@ const components = {
|
||||
OperationContainer: ({ path, method }) => <span className="mocked-op" id={`${path}-${method}`} />
|
||||
}
|
||||
|
||||
describe.only("<Operations/>", function(){
|
||||
describe("<Operations/>", function(){
|
||||
it("should render a Swagger2 `get` method, but not a `trace` or `foo` method", function(){
|
||||
|
||||
let props = {
|
||||
fn: {},
|
||||
specActions: {},
|
||||
layoutActions: {},
|
||||
getComponent: (name)=> {
|
||||
|
||||
return components[name] || null
|
||||
},
|
||||
getConfigs: () => {
|
||||
@@ -60,16 +62,17 @@ describe.only("<Operations/>", function(){
|
||||
|
||||
let wrapper = render(<Operations {...props}/>)
|
||||
|
||||
expect(wrapper.find("span.mocked-op").length).toEqual(2)
|
||||
expect(wrapper.find("span.mocked-op").length).toEqual(1)
|
||||
expect(wrapper.find("span.mocked-op").eq(0).attr("id")).toEqual("/pets/{id}-get")
|
||||
expect(wrapper.find("span.mocked-op").eq(1).attr("id")).toEqual("/pets/{id}-trace")
|
||||
})
|
||||
|
||||
it("should render an OAS3 `get` and `trace` method, but not a `foo` method", function(){
|
||||
|
||||
let props = {
|
||||
fn: {},
|
||||
specActions: {},
|
||||
layoutActions: {},
|
||||
getComponent: (name)=> {
|
||||
|
||||
return components[name] || null
|
||||
},
|
||||
getConfigs: () => {
|
||||
|
||||
Reference in New Issue
Block a user