* build(deps-dev): bump eslint from 8.57.1 to 9.13.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.57.1 to 9.13.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.57.1...v9.13.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Upgrade EsLint * Fix all new lint errors --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dolan Miu <dolan_miu@hotmail.com>
58 lines
1.6 KiB
TypeScript
58 lines
1.6 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
import { Formatter } from "@export/formatter";
|
|
|
|
import { HeaderFooterReference, HeaderFooterReferenceType, HeaderFooterType } from "./header-footer-reference";
|
|
|
|
describe("HeaderFooterReference", () => {
|
|
it("#constructor (footer)", () => {
|
|
const footer = new HeaderFooterReference(HeaderFooterType.FOOTER, {
|
|
type: HeaderFooterReferenceType.DEFAULT,
|
|
id: 1,
|
|
});
|
|
|
|
const tree = new Formatter().format(footer);
|
|
expect(tree).to.deep.equal({
|
|
"w:footerReference": {
|
|
_attr: {
|
|
"r:id": "rId1",
|
|
"w:type": "default",
|
|
},
|
|
},
|
|
});
|
|
});
|
|
|
|
it("#constructor (header)", () => {
|
|
const header = new HeaderFooterReference(HeaderFooterType.HEADER, {
|
|
type: HeaderFooterReferenceType.DEFAULT,
|
|
id: 1,
|
|
});
|
|
|
|
const tree = new Formatter().format(header);
|
|
expect(tree).to.deep.equal({
|
|
"w:headerReference": {
|
|
_attr: {
|
|
"r:id": "rId1",
|
|
"w:type": "default",
|
|
},
|
|
},
|
|
});
|
|
});
|
|
|
|
it("should create without a type", () => {
|
|
const footer = new HeaderFooterReference(HeaderFooterType.FOOTER, {
|
|
id: 1,
|
|
});
|
|
|
|
const tree = new Formatter().format(footer);
|
|
expect(tree).to.deep.equal({
|
|
"w:footerReference": {
|
|
_attr: {
|
|
"r:id": "rId1",
|
|
"w:type": "default",
|
|
},
|
|
},
|
|
});
|
|
});
|
|
});
|