Skip to content

Commit f0b9a1a

Browse files
committed
#41: Reverse changes to test suite files
* Restore scanData.test.js and scandata.json to same state as in the develop branch. Signed-off-by: John M. Horan <[email protected]>
1 parent 8659daf commit f0b9a1a

File tree

2 files changed

+12
-32
lines changed

2 files changed

+12
-32
lines changed

test/data/scandata.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,10 @@
44
"path": "root"
55
},
66
{
7-
"path": "root/dir1",
8-
"type": "directory"
7+
"path": "root/dir1/file1"
98
},
109
{
11-
"path": "root/dir1/file1",
12-
"type": "file"
13-
},
14-
{
15-
"path": "root/dir1/file2",
16-
"type": "file"
10+
"path": "root/dir1/file2"
1711
}
1812
]
1913
}

test/scanData.test.js

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe("getScanData", function () {
1212
it("should return an array", function () {
1313
var json = JSON.parse(fs.readFileSync(__dirname + "/data/scandata.json", "utf8"));
1414
assert.isArray(json.files, "did not return an array");
15-
assert.lengthOf(json.files, 4, "did not return 4 items");
15+
assert.lengthOf(json.files, 3, "did not return 3 items");
1616
var scandata = new ScanData(json);
1717
assert.isArray(scandata.json.files, "did not return an array");
1818
})
@@ -24,38 +24,29 @@ describe("checkJSTreeDataFormat", function () {
2424
id: 'root',
2525
text: 'root',
2626
parent: '#',
27-
type: 'directory',
27+
type: 'file', // TODO: This is a bug that needs to be fixed
2828
scanData: { path: 'root' }
2929
},
3030
{
3131
id: 'root/dir1',
3232
text: 'dir1',
3333
parent: 'root',
34-
type: 'directory',
35-
scanData: {
36-
path: 'root/dir1',
37-
type: 'directory'
38-
}
34+
type: 'folder',
35+
scanData: { path: 'root/dir1/file1' }
3936
},
4037
{
4138
id: 'root/dir1/file1',
4239
text: 'file1',
4340
parent: 'root/dir1',
4441
type: 'file',
45-
scanData: {
46-
path: 'root/dir1/file1',
47-
type: 'file'
48-
}
42+
scanData: { path: 'root/dir1/file1' }
4943
},
5044
{
5145
id: 'root/dir1/file2',
5246
text: 'file2',
5347
parent: 'root/dir1',
5448
type: 'file',
55-
scanData: {
56-
path: 'root/dir1/file2',
57-
type: 'file'
58-
}
49+
scanData: { path: 'root/dir1/file2' }
5950
}
6051
];
6152

@@ -84,8 +75,7 @@ describe("checkNodeViewDataFormat", function () {
8475
"parent": "root/dir1",
8576
"children": [],
8677
"scanData": {
87-
"path": "root/dir1/file1",
88-
"type": "file"
78+
"path": "root/dir1/file1"
8979
}
9080
},
9181
{
@@ -94,14 +84,12 @@ describe("checkNodeViewDataFormat", function () {
9484
"parent": "root/dir1",
9585
"children": [],
9686
"scanData": {
97-
"path": "root/dir1/file2",
98-
"type": "file"
87+
"path": "root/dir1/file2"
9988
}
10089
}
10190
],
10291
"scanData": {
103-
"path": "root/dir1",
104-
"type": "directory"
92+
"path": "root/dir1/file1"
10593
}
10694
}
10795
],
@@ -339,8 +327,6 @@ describe("checkToDejaCodeFormat", function () {
339327
];
340328

341329
it("should return the JSON format DejaCode expects", function () {
342-
// assert.deepEqual(exportToDejaCode.toDejaCodeFormat(savedComponentFormat), expectedDejaCodeFormat);
343-
// 4/15/17 The function no longer exists, but there's a new function. Try that.
344-
assert.deepEqual(exportToDejaCode.uploadComponents(savedComponentFormat), expectedDejaCodeFormat);
330+
assert.deepEqual(exportToDejaCode.toDejaCodeFormat(savedComponentFormat), expectedDejaCodeFormat);
345331
})
346332
});

0 commit comments

Comments
 (0)