forked from swagger-api/swagger-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into ft/oas3-authorization
- Loading branch information
Showing
30 changed files
with
379 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "swagger-ui", | ||
"version": "3.3.1", | ||
"version": "3.3.2", | ||
"main": "dist/swagger-ui.js", | ||
"repository": "[email protected]:swagger-api/swagger-ui.git", | ||
"contributors": [ | ||
|
@@ -32,7 +32,7 @@ | |
"test": "npm run lint-errors && npm run just-test-in-node", | ||
"test-in-node": "npm run lint-errors && npm run just-test-in-node", | ||
"just-test": "karma start --config karma.conf.js", | ||
"just-test-in-node": "mocha --recursive --compilers js:babel-core/register test/core test/components test/bugs test/swagger-ui-dist-package", | ||
"just-test-in-node": "mocha --recursive --compilers js:babel-core/register test/core test/components test/bugs test/swagger-ui-dist-package test/xss", | ||
"test-e2e": "sleep 3 && nightwatch test/e2e/scenarios/ --config test/e2e/nightwatch.json", | ||
"e2e-initial-render": "nightwatch test/e2e/scenarios/ --config test/e2e/nightwatch.json --group initial-render", | ||
"mock-api": "json-server --watch test/e2e/db.json --port 3204", | ||
|
@@ -78,7 +78,7 @@ | |
"scroll-to-element": "^2.0.0", | ||
"serialize-error": "2.0.0", | ||
"shallowequal": "0.2.2", | ||
"swagger-client": "^3.2.0", | ||
"swagger-client": "^3.2.2", | ||
"url-parse": "^1.1.8", | ||
"whatwg-fetch": "0.11.1", | ||
"worker-loader": "^0.7.1", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* eslint-env mocha */ | ||
import React from "react" | ||
import expect from "expect" | ||
import { render } from "enzyme" | ||
import Markdown from "components/providers/markdown" | ||
import { Markdown as OAS3Markdown } from "corePlugins/oas3/wrap-components/markdown.js" | ||
|
||
describe("Markdown component", function() { | ||
describe("Swagger 2.0", function() { | ||
it("allows image elements", function() { | ||
const str = `![Image alt text](http://image.source "Image title")` | ||
const el = render(<Markdown source={str} />) | ||
expect(el.html()).toEqual(`<div class="markdown"><p><img src="http://image.source" title="Image title"></p>\n</div>`) | ||
}) | ||
|
||
it("allows heading elements", function() { | ||
const str = ` | ||
# h1 | ||
## h2 | ||
### h3 | ||
#### h4 | ||
##### h5 | ||
###### h6` | ||
const el = render(<Markdown source={str} />) | ||
expect(el.html()).toEqual(`<div class="markdown"><h1>h1</h1>\n<h2>h2</h2>\n<h3>h3</h3>\n<h4>h4</h4>\n<h5>h5</h5>\n<h6>h6</h6>\n</div>`) | ||
}) | ||
|
||
it("allows links", function() { | ||
const str = `[Link](https://example.com/)` | ||
const el = render(<Markdown source={str} />) | ||
expect(el.html()).toEqual(`<div class="markdown"><p><a href="https://example.com/" target="_blank">Link</a></p>\n</div>`) | ||
}) | ||
}) | ||
|
||
describe("OAS 3", function() { | ||
it("allows image elements", function() { | ||
const str = `![Image alt text](http://image.source "Image title")` | ||
const el = render(<OAS3Markdown source={str} />) | ||
expect(el.html()).toEqual(`<div class="renderedMarkdown"><div><p><img src="http://image.source" title="Image title"></p></div></div>`) | ||
}) | ||
|
||
it("allows heading elements", function() { | ||
const str = ` | ||
# h1 | ||
## h2 | ||
### h3 | ||
#### h4 | ||
##### h5 | ||
###### h6` | ||
const el = render(<OAS3Markdown source={str} />) | ||
expect(el.html()).toEqual(`<div class="renderedMarkdown"><div><h1>h1</h1>\n<h2>h2</h2>\n<h3>h3</h3>\n<h4>h4</h4>\n<h5>h5</h5>\n<h6>h6</h6></div></div>`) | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.