From 1785d48746274f7e6d9727b2edb7ae0920caaab0 Mon Sep 17 00:00:00 2001 From: Owen Conti Date: Sun, 8 Oct 2017 10:13:09 -0600 Subject: [PATCH] Remove .only from existing tests. Add markdown test cases for heading elements. --- test/components/markdown.js | 38 ++++++++++++++++++++++++ test/xss/info-sanitization.js | 2 +- test/xss/markdown-script-sanitization.js | 2 +- 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 test/components/markdown.js diff --git a/test/components/markdown.js b/test/components/markdown.js new file mode 100644 index 00000000..6dd87053 --- /dev/null +++ b/test/components/markdown.js @@ -0,0 +1,38 @@ +/* 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.only("Markdown component", function() { + describe("Swagger 2.0", function() { + it("allows heading elements", function() { + const str = ` +# h1 +## h2 +### h3 +#### h4 +##### h5 +###### h6 + ` + const el = render() + expect(el.html()).toEqual(`

h1

\n

h2

\n

h3

\n

h4

\n
h5
\n
h6
\n
`) + }) + }) + + describe("OAS 3", function() { + it("allows heading elements", function() { + const str = ` + # h1 + ## h2 + ### h3 + #### h4 + ##### h5 + ###### h6 + ` + const el = render() + expect(el.html()).toEqual(`

h1

\n

h2

\n

h3

\n

h4

\n
h5
\n
h6
`) + }) + }) +}) diff --git a/test/xss/info-sanitization.js b/test/xss/info-sanitization.js index 6549aa11..e868fe9f 100644 --- a/test/xss/info-sanitization.js +++ b/test/xss/info-sanitization.js @@ -6,7 +6,7 @@ import { fromJS } from "immutable" import Info from "components/info" import Markdown from "components/providers/markdown" -describe.only(" Sanitization", function(){ +describe(" Sanitization", function(){ const dummyComponent = () => null const components = { Markdown diff --git a/test/xss/markdown-script-sanitization.js b/test/xss/markdown-script-sanitization.js index ef374dd7..9d6624c7 100644 --- a/test/xss/markdown-script-sanitization.js +++ b/test/xss/markdown-script-sanitization.js @@ -5,7 +5,7 @@ import { render } from "enzyme" import Markdown from "components/providers/markdown" import { Markdown as OAS3Markdown } from "corePlugins/oas3/wrap-components/markdown.js" -describe.only("Markdown Script Sanitization", function() { +describe("Markdown Script Sanitization", function() { describe("Swagger 2.0", function() { it("sanitizes `