Documentation and Refactoring (#3028)

* Documentation and Refactoring

* Documentation and Refactoring

* Fix lint issues

* Convert components to Builder style

---------

Co-authored-by: Dolan Miu <dmiu@bloomberg.net>
This commit is contained in:
Dolan
2025-04-14 16:43:15 +05:30
committed by GitHub
parent 8ba9a448d3
commit 4d1a351649
78 changed files with 1178 additions and 620 deletions

View File

@ -2,12 +2,16 @@ import { describe, expect, it } from "vitest";
import { Formatter } from "@export/formatter";
import { MathNAryProperties } from "./math-n-ary-properties";
import { createMathNAryProperties } from "./math-n-ary-properties";
describe("MathNAryProperties", () => {
describe("createMathNAryProperties", () => {
describe("#constructor()", () => {
it("should create a MathNAryProperties with correct root key", () => {
const mathNAryProperties = new MathNAryProperties("∑", true, true);
const mathNAryProperties = createMathNAryProperties({
accent: "∑",
hasSuperScript: true,
hasSubScript: true,
});
const tree = new Formatter().format(mathNAryProperties);
expect(tree).to.deep.equal({
@ -31,7 +35,11 @@ describe("MathNAryProperties", () => {
});
it("should add super-script hide attributes", () => {
const mathNAryProperties = new MathNAryProperties("∑", false, true);
const mathNAryProperties = createMathNAryProperties({
accent: "∑",
hasSuperScript: false,
hasSubScript: true,
});
const tree = new Formatter().format(mathNAryProperties);
expect(tree).to.deep.equal({
@ -62,7 +70,11 @@ describe("MathNAryProperties", () => {
});
it("should add sub-script hide attributes", () => {
const mathNAryProperties = new MathNAryProperties("∑", true, false);
const mathNAryProperties = createMathNAryProperties({
accent: "∑",
hasSuperScript: true,
hasSubScript: false,
});
const tree = new Formatter().format(mathNAryProperties);
expect(tree).to.deep.equal({
@ -93,7 +105,11 @@ describe("MathNAryProperties", () => {
});
it("should add both super-script and sub-script hide attributes", () => {
const mathNAryProperties = new MathNAryProperties("∑", false, false);
const mathNAryProperties = createMathNAryProperties({
accent: "∑",
hasSuperScript: false,
hasSubScript: false,
});
const tree = new Formatter().format(mathNAryProperties);
expect(tree).to.deep.equal({