Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Rename Response -> ResponseSchema
Browse files Browse the repository at this point in the history
  • Loading branch information
Dom Harrington committed Nov 2, 2017
1 parent 2663828 commit 46b0264
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 33 deletions.
32 changes: 0 additions & 32 deletions packages/api-explorer-ui/__tests__/Response.test.jsx

This file was deleted.

32 changes: 32 additions & 0 deletions packages/api-explorer-ui/__tests__/ResponseSchema.test.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const React = require('react');
const { shallow } = require('enzyme');

const ResponseSchema = require('../src/ResponseSchema');
const Oas = require('../src/lib/Oas');
const petstore = require('./fixtures/petstore/oas.json');

const oas = new Oas(petstore);

const props = {
operation: oas.operation('/pet/{petId}', 'get'),
};

describe('selectedStatus', () => {
test('selectedStatus should change state of selectedStatus', () => {
const responseSchema = shallow(<ResponseSchema {...props} />);

expect(responseSchema.state('selectedStatus')).toBe('200');

responseSchema.instance().selectedStatus('400');

expect(responseSchema.state('selectedStatus')).toBe('400');
});
});

describe('ResponseSchema', () => {
test('should display response schema', () => {
const responseSchema = shallow(<ResponseSchema {...props} />);

expect(responseSchema.find('p.desc').text()).toBe(props.operation.responses['200'].description);
});
});
2 changes: 1 addition & 1 deletion packages/api-explorer-ui/src/Doc.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const PathUrl = require('./PathUrl');
const Params = require('./Params');
const CodeSample = require('./CodeSample');
const CodeSampleResponse = require('./CodeSampleResponse');
const ResponseSchema = require('./Response');
const ResponseSchema = require('./ResponseSchema');

const Oas = require('./lib/Oas');
const showCode = require('./lib/show-code');
Expand Down

0 comments on commit 46b0264

Please sign in to comment.