Page MenuHomeSealhub

table.test.ts
No OneTemporary

table.test.ts

import { Table } from "./table.js";
import { Structured } from "./structured.js";
import { List } from "./list.js";
import { ShortText } from "./short-text.js";
import { ExtractParsed } from "./component-argument.js";
describe("table argument", () => {
it("properly parses type value", () => {
const table_arg = new Table(
new Structured(<const>{
value: new ShortText().setExampleValues([""]),
tags: new List(new ShortText()),
}),
new Structured({
tags: new List(new ShortText()).setExampleValues([["okazja"]]),
})
);
const table_value = {
rows: [
{ type: "row", cells: [] },
{ type: "header", value: "", tags: [] },
],
} as ExtractParsed<typeof table_arg>;
table_value.rows.map((row) => {
if (row.type == "row") {
row.cells.map((cell) => {
cell.tags.map((tag) => tag); // if the types are written correctly, this will typecheck OK
});
}
});
});
});

File Metadata

Mime Type
text/x-java
Expires
Sat, Sep 20, 14:28 (1 d, 13 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
929296
Default Alt Text
table.test.ts (924 B)

Event Timeline