2018-10-19 16:50:51 -03:00
|
|
|
import { expect } from "chai";
|
|
|
|
|
2018-10-26 01:04:07 +01:00
|
|
|
import { Formatter } from "export/formatter";
|
|
|
|
|
2018-10-19 16:50:51 -03:00
|
|
|
import { SequentialIdentifier } from "./sequential-identifier";
|
|
|
|
|
|
|
|
describe("Sequential Identifier", () => {
|
|
|
|
describe("#constructor", () => {
|
|
|
|
it("should construct a SEQ without options", () => {
|
|
|
|
const seq = new SequentialIdentifier("Figure");
|
|
|
|
const tree = new Formatter().format(seq);
|
|
|
|
expect(tree).to.be.deep.equal(DEFAULT_SEQ);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
const DEFAULT_SEQ = {
|
|
|
|
"w:r": [
|
|
|
|
{
|
2019-04-09 05:27:18 -04:00
|
|
|
"w:fldChar": {
|
|
|
|
_attr: {
|
|
|
|
"w:fldCharType": "begin",
|
|
|
|
"w:dirty": true,
|
2018-10-19 16:50:51 -03:00
|
|
|
},
|
2019-04-09 05:27:18 -04:00
|
|
|
},
|
2018-10-19 16:50:51 -03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"w:instrText": [
|
|
|
|
{
|
|
|
|
_attr: {
|
|
|
|
"xml:space": "preserve",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"SEQ Figure",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
2019-04-09 05:27:18 -04:00
|
|
|
"w:fldChar": {
|
|
|
|
_attr: {
|
|
|
|
"w:fldCharType": "separate",
|
2018-10-19 16:50:51 -03:00
|
|
|
},
|
2019-04-09 05:27:18 -04:00
|
|
|
},
|
2018-10-19 16:50:51 -03:00
|
|
|
},
|
|
|
|
{
|
2019-04-09 05:27:18 -04:00
|
|
|
"w:fldChar": {
|
|
|
|
_attr: {
|
|
|
|
"w:fldCharType": "end",
|
2018-10-19 16:50:51 -03:00
|
|
|
},
|
2019-04-09 05:27:18 -04:00
|
|
|
},
|
2018-10-19 16:50:51 -03:00
|
|
|
},
|
|
|
|
],
|
|
|
|
};
|