2017-03-07 22:15:53 +00:00
|
|
|
import { Properties } from "../properties";
|
|
|
|
import { assert } from "chai";
|
2016-04-03 20:00:30 +01:00
|
|
|
|
|
|
|
function jsonify(obj: Object) {
|
2016-05-26 15:08:34 +01:00
|
|
|
let stringifiedJson = JSON.stringify(obj);
|
2016-04-03 20:00:30 +01:00
|
|
|
return JSON.parse(stringifiedJson);
|
|
|
|
}
|
|
|
|
|
|
|
|
describe("Properties", () => {
|
2016-05-26 15:08:34 +01:00
|
|
|
let properties: Properties;
|
2016-04-03 20:00:30 +01:00
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
describe("#constructor()", () => {
|
|
|
|
it("should create properties with a title", () => {
|
|
|
|
properties = new Properties({
|
|
|
|
title: "test document"
|
|
|
|
});
|
2016-05-26 15:08:34 +01:00
|
|
|
let newJson = jsonify(properties);
|
2016-05-02 22:39:03 +01:00
|
|
|
assert(newJson.root[1].root === "test document");
|
2016-04-03 20:00:30 +01:00
|
|
|
});
|
2016-05-26 15:08:34 +01:00
|
|
|
});
|
2016-04-03 20:00:30 +01:00
|
|
|
});
|