Skip to content

Commit 3dcb850

Browse files
A stub test for TDD of copy
1 parent 4d1fabb commit 3dcb850

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

test/copy.test.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
'use strict';
2+
3+
import {assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts";
4+
import {Graph} from '../src/graph.js';
5+
6+
// Tests for copying subtrees from this sample input
7+
8+
const url = 'http://ward.dojo.fed.wiki/assets/pages/identifying-distinct-activities/1272024.graph.json'
9+
const input = await Graph.fetch(url)
10+
11+
// 0 => {"type":"Page","in":[4],"out":[0,1],"props":{"name":"Mixing\nBackground\nColors"}}
12+
// 1 => {"type":"Page","in":[0],"out":[4],"props":{"name":"Transmission\nColor\nModel"}}
13+
// 2 => {"type":"Page","in":[1],"out":[],"props":{"name":"Watch\nthe\nWeave"}}
14+
// 3 => {"type":"Page","in":[],"out":[2,3],"props":{"name":"Search\nIndex\nLogs"}}
15+
// 4 => {"type":"Page","in":[2],"out":[],"props":{"name":"Solo\nSuper\nCollaborator"}}
16+
// 5 => {"type":"Page","in":[3],"out":[],"props":{"name":"Sites\nto\nbe\nIndexed"}}
17+
// 6 => {"type":"Page","in":[],"out":[],"props":{"name":"Indexing\nthe\nUnknown"}}
18+
19+
// 0 => {"type":"","from":0,"to":1,"props":{"source":"1/27/2024"}}
20+
// 1 => {"type":"","from":0,"to":2,"props":{"source":"1/27/2024"}}
21+
// 2 => {"type":"","from":3,"to":4,"props":{"source":"1/27/2024"}}
22+
// 3 => {"type":"","from":3,"to":5,"props":{"source":"1/27/2024"}}
23+
// 4 => {"type":"","from":1,"to":0,"props":{"source":"1/27/2024"}}
24+
25+
Deno.test("We have expected input", async () => {
26+
assertEquals(input.nodes.length, 7);
27+
assertEquals(input.rels.length, 5)
28+
});

0 commit comments

Comments
 (0)