Skip to content

Commit 10d70b8

Browse files
committed
Include graphs directly in graphs test module.
1 parent 05caf3a commit 10d70b8

File tree

6 files changed

+6
-61
lines changed

6 files changed

+6
-61
lines changed

test-browser/full-polyfill.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
<script src="../viz.js"></script>
1212
<script src="../full.render.js"></script>
1313
<script src="vendor/fabric.js"></script>
14-
<script src="vendor/fetch.js"></script>
1514
<script src="vendor/promise-polyfill.js"></script>
1615
<script src="vendor/qunit.js"></script>
1716
<script src="config.js"></script>

test-browser/graphs/edge-labels.dot

Lines changed: 0 additions & 15 deletions
This file was deleted.

test-browser/graphs/shapes.dot

Lines changed: 0 additions & 9 deletions
This file was deleted.

test-browser/graphs/subgraphs.dot

Lines changed: 0 additions & 31 deletions
This file was deleted.

test-browser/lite-polyfill.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
<script src="../viz.js"></script>
1212
<script src="../lite.render.js"></script>
1313
<script src="vendor/fabric.js"></script>
14-
<script src="vendor/fetch.js"></script>
1514
<script src="vendor/promise-polyfill.js"></script>
1615
<script src="vendor/qunit.js"></script>
1716
<script src="config.js"></script>

test-browser/modules/graphs.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
QUnit.module("graphs");
22

33
QUnit.test("rendering sample graphs should not throw errors", function(assert) {
4-
var graphs = ["./graphs/shapes.dot", "./graphs/subgraphs.dot", "./graphs/edge-labels.dot"];
4+
var graphs = [
5+
"digraph g {\n n1 [shape = circle];\n n2 [shape = egg];\n n3 [shape = triangle];\n n4 [shape = diamond];\n n5 [shape = trapezium];\n}",
6+
"digraph g {\n \n {rank = same; n1; n2; n3; n4; n5}\n \n n1 -> n2;\n n2 -> n3;\n n3 -> n4;\n n4 -> n5;\n \n subgraph cluster1 {\n label = \"cluster1\";\n color = lightgray;\n style = filled;\n \n n6;\n }\n \n subgraph cluster2 {\n label = \"cluster2\";\n color = red;\n \n n7;\n n8;\n }\n \n n1 -> n6;\n n2 -> n7;\n n8 -> n3;\n n6 -> n7;\n \n}",
7+
"digraph g {\nnode001->node002;\nsubgraph cluster1 {\n node003;\n node004;\n node005;\n}\nnode006->node002;\nnode007->node005;\nnode007->node002;\nnode007->node008;\nnode002->node005[label=\"x\"];\nnode004->node007;\n}"
8+
];
59

610
var results = graphs.map(function(graph) {
711
var viz = new Viz();
812

9-
return fetch(graph)
10-
.then(function(response) { return response.text(); })
11-
.then(function(text) { return viz.renderString(text); })
13+
return viz.renderString(graph)
1214
.then(function(str) { assert.ok(str); });
1315
});
1416

0 commit comments

Comments
 (0)