Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b418474
commit 1f58fd8
Showing
7 changed files
with
126 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from "react"; | ||
import ReactDOM from "react-dom"; | ||
import App from "./App"; | ||
|
||
it("renders without crashing", () => { | ||
const div = document.createElement("div"); | ||
ReactDOM.render(<App />, div); | ||
ReactDOM.unmountComponentAtNode(div); | ||
}); |
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,26 @@ | ||
import React from "react"; | ||
import ReactDOM from "react-dom"; | ||
import JSONValidationErrorList from "./JSONValidationErrorList"; | ||
import * as monaco from "monaco-editor"; | ||
|
||
it("renders without crashing", () => { | ||
const div = document.createElement("div"); | ||
ReactDOM.render(<JSONValidationErrorList markers={[]}/>, div); | ||
ReactDOM.unmountComponentAtNode(div); | ||
}); | ||
|
||
it("renders validation error list with markers", () => { | ||
const div = document.createElement("div"); | ||
const markers: monaco.editor.IMarker[] = [ | ||
{ | ||
startLineNumber: 2, | ||
startColumn: 10, | ||
message: "bad thing", | ||
} as monaco.editor.IMarker, | ||
]; | ||
ReactDOM.render(<JSONValidationErrorList markers={markers} />, div); | ||
expect(div.innerHTML.includes("2")).toBe(true); | ||
expect(div.innerHTML.includes("10")).toBe(true); | ||
expect(div.innerHTML.includes("bad thing")).toBe(true); | ||
ReactDOM.unmountComponentAtNode(div); | ||
}); |
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,49 @@ | ||
import React from "react"; | ||
import ReactDOM from "react-dom"; | ||
import PlaygroundSplitPane from "./PlaygroundSplitPane"; | ||
import * as monaco from "monaco-editor"; | ||
|
||
it("renders without crashing", () => { | ||
const div = document.createElement("div"); | ||
ReactDOM.render(<PlaygroundSplitPane | ||
left={ | ||
<div>Foo</div> | ||
} | ||
right={ | ||
<div>Bar</div> | ||
} | ||
/>, div); | ||
ReactDOM.unmountComponentAtNode(div); | ||
}); | ||
|
||
it("renders playground with left and right with split true", () => { | ||
const div = document.createElement("div"); | ||
ReactDOM.render(<PlaygroundSplitPane | ||
split={true} | ||
left={ | ||
<div>Foo</div> | ||
} | ||
right={ | ||
<div>Bar</div> | ||
} | ||
/>, div); | ||
expect(div.innerHTML.includes("Foo")).toBe(true); | ||
expect(div.innerHTML.includes("Bar")).toBe(true); | ||
ReactDOM.unmountComponentAtNode(div); | ||
}); | ||
|
||
it("renders playground without left when split is false", () => { | ||
const div = document.createElement("div"); | ||
ReactDOM.render(<PlaygroundSplitPane | ||
split={false} | ||
left={ | ||
<div>Foo</div> | ||
} | ||
right={ | ||
<div>Bar</div> | ||
} | ||
/>, div); | ||
expect(div.innerHTML.includes("Foo")).toBe(false); | ||
expect(div.innerHTML.includes("Bar")).toBe(true); | ||
ReactDOM.unmountComponentAtNode(div); | ||
}); |
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