mirror of
https://github.com/nasa/openmct.git
synced 2025-04-15 15:06:47 +00:00
[CSV Export] Verify CSV data content
This commit is contained in:
parent
54c67b891c
commit
300d71ddc2
@ -68,7 +68,19 @@ define(
|
||||
});
|
||||
|
||||
it("includes headers from the data set", function () {
|
||||
expect(csvContents[0]).toEqual([ 'a', 'b', 'c' ]);
|
||||
expect(csvContents[0])
|
||||
.toEqual(Object.keys(testRows[0]).sort());
|
||||
});
|
||||
|
||||
it("includes data from the data set", function () {
|
||||
var headers = csvContents[0],
|
||||
expectedData = testRows.map(function (row) {
|
||||
return headers.map(function (key) {
|
||||
return String(row[key]);
|
||||
});
|
||||
});
|
||||
// Everything after header should be data
|
||||
expect(csvContents.slice(1)).toEqual(expectedData);
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user