|
1 | | -import * as layout from "@hpcc-js/layout"; |
2 | | -import { AbsoluteSurface, Accordion, Border, Border2, Carousel, Cell, ChartPanel, FlexGrid, Grid, HorizontalList, Layered, Legend, Modal, Popup, Surface, Tabbed, Toolbar, VerticalList } from "@hpcc-js/layout"; |
3 | 1 | import { Class, EntityCard, HTMLWidget, Icon, SVGWidget } from "@hpcc-js/common"; |
4 | 2 | import { Bar, Column, Line, Pie, Step } from "@hpcc-js/chart"; |
5 | 3 | import { describe, it, expect } from "vitest"; |
6 | 4 | import { classDef, data, render } from "../../common/tests/index.ts"; |
7 | 5 |
|
8 | 6 | const urlSearch: string = window.location.href.split("?")[1]; |
9 | 7 |
|
10 | | -describe("@hpcc-js/layout", () => { |
11 | | - for (const key in layout) { |
12 | | - const item = (layout as any)[key]; |
| 8 | +describe("@hpcc-js/layout", async () => { |
| 9 | + const script = document.createElement("script"); |
| 10 | + script.src = import.meta.resolve("../../dgrid-shim/dist/index.js"); |
| 11 | + script.type = "text/javascript"; |
| 12 | + document.head.appendChild(script); |
| 13 | + |
| 14 | + await new Promise<void>((resolve) => { |
| 15 | + script.onload = () => { |
| 16 | + console.log("dgrid-shim loaded"); |
| 17 | + resolve(); |
| 18 | + }; |
| 19 | + }); |
| 20 | + |
| 21 | + it("Shim Loaded", () => { |
| 22 | + expect(globalThis["@hpcc-js/dgrid-shim"]).to.exist; |
| 23 | + }); |
| 24 | + |
| 25 | + const layoutMod = await import("@hpcc-js/layout"); |
| 26 | + |
| 27 | + it("dgridMod Loaded", () => { |
| 28 | + expect(layoutMod).to.exist; |
| 29 | + }); |
| 30 | + |
| 31 | + const { AbsoluteSurface, Accordion, Border, Border2, Carousel, Cell, ChartPanel, FlexGrid, Grid, HorizontalList, Layered, Legend, Modal, Popup, Surface, Tabbed, Toolbar, VerticalList } = layoutMod; |
| 32 | + |
| 33 | + for (const key in layoutMod) { |
| 34 | + const item = (layoutMod as any)[key]; |
13 | 35 | if (item) { |
14 | 36 | if (!urlSearch || urlSearch === item.prototype.constructor.name) { |
15 | 37 | describe(`${item.prototype?.constructor?.name}`, () => { |
|
0 commit comments