diff --git a/example/swagger-files/types.json b/example/swagger-files/types.json index 8a7361bce..32062253d 100644 --- a/example/swagger-files/types.json +++ b/example/swagger-files/types.json @@ -26,6 +26,10 @@ "type": "string", "description": "This is a string with a description" }, + "string with markdown description": { + "type": "string", + "description": "This is a string with a **markdown** description: [link](ref:action-object)" + }, "string without description": { "type": "string" }, diff --git a/packages/api-explorer/__tests__/Params.test.jsx b/packages/api-explorer/__tests__/Params.test.jsx index 1d4e00892..ad71232a1 100644 --- a/packages/api-explorer/__tests__/Params.test.jsx +++ b/packages/api-explorer/__tests__/Params.test.jsx @@ -2,6 +2,8 @@ const React = require('react'); const { mount } = require('enzyme'); const extensions = require('@readme/oas-extensions'); +const Description = require('../src/form-components/DescriptionField'); + const createParams = require('../src/Params'); const Oas = require('../src/lib/Oas'); @@ -34,6 +36,15 @@ describe('form id attribute', () => { }); }); +test('should use custom description component', () => { + const params = mount( +
+ +
, + ); + expect(params.find(Description).length).toBe(1); +}); + test('boolean should render as