@malloy-publisher/sdk 0.9.10 → 0.9.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{RenderedResult-Dp1Qdajz.es.js → RenderedResult-CDiXJAh9.es.js} +102 -102
- package/dist/RenderedResult-De51QvsZ.cjs.js +153 -0
- package/dist/ServerProvider-DKrBcXL7.cjs.js +1 -0
- package/dist/{ServerProvider-CQy4jVYK.es.js → ServerProvider-RvKSbvnL.es.js} +622 -587
- package/dist/builder/index.cjs.js +78 -130
- package/dist/builder/index.es.js +7493 -6769
- package/dist/builder-entry.d.ts +3 -0
- package/dist/client/api.d.ts +72 -23
- package/dist/client/index.cjs.js +1 -1
- package/dist/client/index.es.js +1 -1
- package/dist/components/AppDialog.d.ts +9 -1
- package/dist/components/Connections/common.d.ts +11 -3
- package/dist/components/Dashboard/DashboardGrid.d.ts +14 -15
- package/dist/components/Dashboard/DashboardTile.d.ts +8 -1
- package/dist/components/Dashboard/DashboardView.d.ts +22 -34
- package/dist/components/Dashboard/TileCard.d.ts +10 -3
- package/dist/components/Dashboard/useStuck.d.ts +15 -7
- package/dist/components/DocumentCreate/useDocumentChoices.d.ts +6 -0
- package/dist/components/Package/PackageProblems.d.ts +14 -0
- package/dist/components/RemoveBadge.d.ts +40 -0
- package/dist/components/Report/Report.d.ts +13 -4
- package/dist/components/Report/ReportPage.d.ts +60 -0
- package/dist/components/Report/layoutRules.d.ts +32 -0
- package/dist/components/Report/reportQuery.d.ts +30 -0
- package/dist/components/Report/telemetry.d.ts +0 -2
- package/dist/components/ReportBuilder/AddTileDialog.d.ts +22 -3
- package/dist/components/ReportBuilder/BuilderBar.d.ts +17 -0
- package/dist/components/ReportBuilder/BuilderDialogs.d.ts +7 -6
- package/dist/components/ReportBuilder/BuilderGrid.d.ts +10 -4
- package/dist/components/ReportBuilder/BuilderHeader.d.ts +4 -7
- package/dist/components/ReportBuilder/BuilderToolbar.d.ts +88 -0
- package/dist/components/ReportBuilder/DrillDialog.d.ts +3 -1
- package/dist/components/ReportBuilder/EditorSurface.d.ts +7 -9
- package/dist/components/ReportBuilder/FilterDialog.d.ts +3 -1
- package/dist/components/ReportBuilder/FilterStrip.d.ts +30 -8
- package/dist/components/ReportBuilder/InlineMarkdown.d.ts +4 -4
- package/dist/components/ReportBuilder/ReportBuilder.d.ts +49 -12
- package/dist/components/ReportBuilder/ReportEditor.d.ts +53 -3
- package/dist/components/ReportBuilder/TextTileBody.d.ts +2 -5
- package/dist/components/ReportBuilder/TileFrame.d.ts +10 -4
- package/dist/components/ReportBuilder/TileMenu.d.ts +12 -9
- package/dist/components/ReportBuilder/ViewPicker.d.ts +53 -0
- package/dist/components/ReportBuilder/addTileToDocument.d.ts +24 -3
- package/dist/components/ReportBuilder/builderControls.d.ts +60 -0
- package/dist/components/ReportBuilder/catalog.d.ts +2 -4
- package/dist/components/ReportBuilder/inlineEdit.d.ts +9 -10
- package/dist/components/ReportBuilder/localGiven.d.ts +12 -0
- package/dist/components/ReportBuilder/preview.d.ts +17 -2
- package/dist/components/ReportBuilder/readDocument.d.ts +0 -2
- package/dist/components/ReportBuilder/readForEditor.d.ts +2 -7
- package/dist/components/ReportBuilder/reportTag.d.ts +11 -1
- package/dist/components/ReportBuilder/sortable.d.ts +4 -3
- package/dist/components/ReportBuilder/testing/inline.d.ts +5 -1
- package/dist/components/ReportBuilder/useBuilderSelection.d.ts +0 -1
- package/dist/components/ReportBuilder/useBuilderSession.d.ts +21 -12
- package/dist/components/ReportBuilder/useDocumentEditor.d.ts +2 -6
- package/dist/components/ReportBuilder/useExitGuard.d.ts +3 -0
- package/dist/components/ReportBuilder/useFilterForm.d.ts +3 -1
- package/dist/components/ReportBuilder/useOpenedDocument.d.ts +0 -4
- package/dist/components/ReportBuilder/useReportDraft.d.ts +66 -0
- package/dist/components/ReportBuilder/useReportEditor.d.ts +0 -9
- package/dist/components/ReportBuilder/useTileEditing.d.ts +6 -3
- package/dist/components/ReportBuilder/viewAnnotations.d.ts +9 -0
- package/dist/components/ReportBuilder/widthLabel.d.ts +6 -0
- package/dist/components/ServerProvider.d.ts +9 -0
- package/dist/components/controlTokens.d.ts +45 -0
- package/dist/components/drill/markDrillableCells.d.ts +1 -1
- package/dist/components/given/FilterButton.d.ts +35 -0
- package/dist/components/given/GivensPanel.d.ts +2 -1
- package/dist/components/given/filterEditing.d.ts +54 -0
- package/dist/components/given/filterSummary.d.ts +9 -0
- package/dist/components/given/paramCodec.d.ts +11 -0
- package/dist/components/given/required.d.ts +25 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/legacy/index.d.ts +1 -1
- package/dist/components/{Report/CellReport.d.ts → legacy/malloynb/CellRunnerView.d.ts} +9 -17
- package/dist/components/legacy/{MalloynbCells.d.ts → malloynb/MalloynbCells.d.ts} +3 -3
- package/dist/components/legacy/{Notebook.d.ts → malloynb/Notebook.d.ts} +1 -1
- package/dist/components/{Notebook → legacy/malloynb}/NotebookCell.d.ts +3 -3
- package/dist/components/legacy/malloynb/cellKind.d.ts +5 -0
- package/dist/components/{Notebook → legacy/malloynb}/types.d.ts +1 -1
- package/dist/components/styles.d.ts +0 -2
- package/dist/hooks/useQueryResult.d.ts +7 -0
- package/dist/index.cjs.js +16 -19
- package/dist/index.es.js +8418 -7722
- package/dist/theme/ThemeContext.d.ts +8 -1
- package/dist/theme/classes.d.ts +49 -0
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/types.d.ts +7 -0
- package/dist/theme/ui.d.ts +75 -0
- package/dist/{useCompiledDocument-BMPDvdFx.es.js → useCompiledDocument-Bf4RSfB6.es.js} +8669 -7851
- package/dist/useCompiledDocument-XsQz85Ri.cjs.js +141 -0
- package/package.json +2 -2
- package/src/builder-entry.ts +9 -0
- package/src/components/AppDialog.tsx +23 -0
- package/src/components/Connections/AddConnectionDialog.tsx +34 -2
- package/src/components/Connections/EditConnectionDialog.tsx +45 -3
- package/src/components/Connections/common.spec.ts +69 -0
- package/src/components/Connections/common.ts +132 -0
- package/src/components/Dashboard/DashboardGrid.tsx +39 -17
- package/src/components/Dashboard/DashboardTile.tsx +19 -2
- package/src/components/Dashboard/DashboardView.spec.tsx +216 -15
- package/src/components/Dashboard/DashboardView.tsx +137 -155
- package/src/components/Dashboard/RowsDialog.tsx +1 -2
- package/src/components/Dashboard/TileCard.tsx +28 -10
- package/src/components/Dashboard/defaultTileSpan.spec.ts +24 -0
- package/src/components/Dashboard/useStuck.ts +28 -17
- package/src/components/DocumentCreate/useDocumentChoices.ts +19 -2
- package/src/components/Environment/Connections.tsx +1 -0
- package/src/components/Package/NewDocumentDialog.spec.tsx +76 -59
- package/src/components/Package/NewDocumentDialog.tsx +383 -119
- package/src/components/Package/Package.artifacts.spec.tsx +1 -1
- package/src/components/Package/Package.create.spec.tsx +7 -6
- package/src/components/Package/Package.tsx +10 -7
- package/src/components/Package/PackageProblems.spec.tsx +41 -0
- package/src/components/Package/PackageProblems.tsx +95 -0
- package/src/components/Prose.tsx +12 -7
- package/src/components/RemoveBadge.tsx +94 -0
- package/src/components/RenderedResult/RenderedResult.tsx +5 -9
- package/src/components/RenderedResult/ResultPanel.tsx +59 -3
- package/src/components/Report/Report.spec.tsx +50 -32
- package/src/components/Report/Report.telemetry.spec.tsx +0 -45
- package/src/components/Report/Report.tsx +45 -77
- package/src/components/Report/ReportPage.tsx +168 -0
- package/src/components/Report/layoutRules.spec.ts +35 -0
- package/src/components/Report/layoutRules.ts +55 -0
- package/src/components/Report/reportQuery.ts +53 -0
- package/src/components/Report/telemetry.ts +0 -2
- package/src/components/ReportBuilder/AddTileDialog.spec.tsx +76 -41
- package/src/components/ReportBuilder/AddTileDialog.tsx +368 -133
- package/src/components/ReportBuilder/BuilderBar.tsx +599 -0
- package/src/components/ReportBuilder/BuilderDialogs.tsx +28 -39
- package/src/components/ReportBuilder/BuilderGrid.tsx +31 -29
- package/src/components/ReportBuilder/BuilderHeader.tsx +63 -75
- package/src/components/ReportBuilder/BuilderToolbar.tsx +95 -9
- package/src/components/ReportBuilder/DrillDialog.tsx +240 -128
- package/src/components/ReportBuilder/EditorSurface.tsx +345 -69
- package/src/components/ReportBuilder/FilterDialog.tsx +516 -166
- package/src/components/ReportBuilder/FilterStrip.tsx +130 -151
- package/src/components/ReportBuilder/InlineMarkdown.tsx +71 -45
- package/src/components/ReportBuilder/ReportBuilder.charts.spec.tsx +35 -40
- package/src/components/ReportBuilder/ReportBuilder.controls.spec.tsx +491 -0
- package/src/components/ReportBuilder/ReportBuilder.exit.spec.tsx +2 -4
- package/src/components/ReportBuilder/ReportBuilder.inline.spec.tsx +13 -15
- package/src/components/ReportBuilder/ReportBuilder.notebook.spec.tsx +27 -118
- package/src/components/ReportBuilder/ReportBuilder.openDraft.spec.tsx +12 -5
- package/src/components/ReportBuilder/ReportBuilder.sources.spec.tsx +2 -10
- package/src/components/ReportBuilder/ReportBuilder.spec.tsx +37 -31
- package/src/components/ReportBuilder/ReportBuilder.textTiles.spec.tsx +22 -15
- package/src/components/ReportBuilder/ReportBuilder.tsx +292 -117
- package/src/components/ReportBuilder/ReportEditor.emptyStart.spec.tsx +2 -1
- package/src/components/ReportBuilder/ReportEditor.modelFilters.spec.tsx +312 -0
- package/src/components/ReportBuilder/ReportEditor.notebook.spec.tsx +26 -75
- package/src/components/ReportBuilder/ReportEditor.package.spec.tsx +6 -2
- package/src/components/ReportBuilder/ReportEditor.resourceUri.spec.tsx +3 -2
- package/src/components/ReportBuilder/ReportEditor.spec.tsx +2 -4
- package/src/components/ReportBuilder/ReportEditor.textSource.spec.tsx +93 -13
- package/src/components/ReportBuilder/ReportEditor.tsx +104 -14
- package/src/components/ReportBuilder/TextTileBody.tsx +6 -7
- package/src/components/ReportBuilder/TileFrame.tsx +212 -75
- package/src/components/ReportBuilder/TileMenu.tsx +241 -140
- package/src/components/ReportBuilder/ViewPicker.tsx +349 -0
- package/src/components/ReportBuilder/addTile.compile.spec.ts +1 -1
- package/src/components/ReportBuilder/addTileToDocument.spec.ts +102 -3
- package/src/components/ReportBuilder/addTileToDocument.ts +122 -25
- package/src/components/ReportBuilder/builderControls.ts +164 -0
- package/src/components/ReportBuilder/builderReport.ts +1 -2
- package/src/components/ReportBuilder/catalog.ts +10 -26
- package/src/components/ReportBuilder/inlineEdit.tsx +22 -54
- package/src/components/ReportBuilder/localGiven.ts +56 -0
- package/src/components/ReportBuilder/preview.spec.ts +125 -5
- package/src/components/ReportBuilder/preview.ts +60 -44
- package/src/components/ReportBuilder/readDocument.spec.ts +16 -22
- package/src/components/ReportBuilder/readDocument.ts +14 -11
- package/src/components/ReportBuilder/readForEditor.spec.ts +12 -41
- package/src/components/ReportBuilder/readForEditor.ts +4 -26
- package/src/components/ReportBuilder/reportTag.ts +28 -7
- package/src/components/ReportBuilder/sortable.tsx +15 -7
- package/src/components/ReportBuilder/spliceDocument.imports.spec.ts +1 -1
- package/src/components/ReportBuilder/tagParse.spec.ts +0 -40
- package/src/components/ReportBuilder/testing/inline.ts +25 -5
- package/src/components/ReportBuilder/testing/reportLayoutParity.json +13 -8
- package/src/components/ReportBuilder/textTiles.spec.ts +7 -6
- package/src/components/ReportBuilder/useBuilderSelection.ts +35 -0
- package/src/components/ReportBuilder/useBuilderSession.spec.ts +2 -2
- package/src/components/ReportBuilder/useBuilderSession.ts +21 -13
- package/src/components/ReportBuilder/useDocumentEditor.spec.ts +0 -58
- package/src/components/ReportBuilder/useDocumentEditor.ts +3 -16
- package/src/components/ReportBuilder/useEditorCatalog.spec.tsx +26 -0
- package/src/components/ReportBuilder/useEditorCatalog.ts +7 -2
- package/src/components/ReportBuilder/useExitGuard.ts +16 -0
- package/src/components/ReportBuilder/useFilterForm.spec.tsx +17 -0
- package/src/components/ReportBuilder/useFilterForm.ts +5 -1
- package/src/components/ReportBuilder/useOpenedDocument.ts +0 -2
- package/src/components/ReportBuilder/useReportDraft.spec.ts +149 -0
- package/src/components/ReportBuilder/useReportDraft.ts +292 -0
- package/src/components/ReportBuilder/useReportEditor.ts +3 -12
- package/src/components/ReportBuilder/useSaveChannel.ts +0 -1
- package/src/components/ReportBuilder/useTileEditing.ts +43 -12
- package/src/components/ReportBuilder/viewAnnotations.ts +29 -0
- package/src/components/ReportBuilder/widthLabel.spec.ts +25 -0
- package/src/components/ReportBuilder/widthLabel.ts +26 -0
- package/src/components/ServerProvider.tsx +11 -0
- package/src/components/controlTokens.ts +47 -0
- package/src/components/drill/markDrillableCells.ts +2 -1
- package/src/components/given/FilterButton.spec.tsx +143 -0
- package/src/components/given/FilterButton.tsx +478 -0
- package/src/components/given/GivenInput.spec.tsx +47 -0
- package/src/components/given/GivenInput.tsx +20 -2
- package/src/components/given/GivensPanel.spec.tsx +11 -3
- package/src/components/given/GivensPanel.tsx +45 -44
- package/src/components/given/filterEditing.ts +60 -0
- package/src/components/given/filterSummary.spec.ts +108 -0
- package/src/components/given/filterSummary.ts +109 -0
- package/src/components/given/paramCodec.ts +1 -1
- package/src/components/given/required.spec.ts +60 -0
- package/src/components/given/required.ts +78 -0
- package/src/components/index.ts +9 -0
- package/src/components/legacy/Dashboard.spec.tsx +3 -1
- package/src/components/legacy/index.ts +1 -1
- package/src/components/{Report/CellReport.spec.tsx → legacy/malloynb/CellRunnerView.spec.tsx} +53 -57
- package/src/components/{Report/CellReport.tsx → legacy/malloynb/CellRunnerView.tsx} +122 -136
- package/src/components/legacy/{MalloynbCells.tsx → malloynb/MalloynbCells.tsx} +6 -6
- package/src/components/legacy/{Notebook.layout.spec.tsx → malloynb/Notebook.layout.spec.tsx} +16 -7
- package/src/components/legacy/malloynb/Notebook.served.spec.tsx +84 -0
- package/src/components/legacy/{Notebook.spec.tsx → malloynb/Notebook.spec.tsx} +5 -3
- package/src/components/legacy/{Notebook.tsx → malloynb/Notebook.tsx} +9 -7
- package/src/components/{Notebook → legacy/malloynb}/NotebookCell.tsx +70 -150
- package/src/components/legacy/malloynb/cellKind.spec.ts +33 -0
- package/src/components/legacy/malloynb/cellKind.ts +24 -0
- package/src/components/{Notebook → legacy/malloynb}/types.ts +1 -1
- package/src/components/styles.ts +0 -18
- package/src/hooks/useGivensState.ts +7 -3
- package/src/hooks/useQueryResult.placeholder.spec.ts +44 -0
- package/src/hooks/useQueryResult.ts +26 -1
- package/src/theme/ThemeContext.tsx +21 -1
- package/src/theme/classes.ts +52 -0
- package/src/theme/index.ts +8 -0
- package/src/theme/resolveTheme.ts +3 -0
- package/src/theme/types.ts +7 -0
- package/src/theme/ui.spec.tsx +91 -0
- package/src/theme/ui.ts +115 -0
- package/dist/RenderedResult-BcgYjkZ0.cjs.js +0 -153
- package/dist/ServerProvider-B0dUY8be.cjs.js +0 -1
- package/dist/components/Notebook/cellKind.d.ts +0 -20
- package/dist/components/Report/LinearReport.d.ts +0 -18
- package/dist/components/ReportBuilder/SourceViewPicker.d.ts +0 -9
- package/dist/components/ReportBuilder/legacyNotebook.d.ts +0 -73
- package/dist/components/ReportBuilder/useConversionConfirm.d.ts +0 -20
- package/dist/useCompiledDocument-UY28ITET.cjs.js +0 -141
- package/src/components/Notebook/cellKind.spec.ts +0 -199
- package/src/components/Notebook/cellKind.ts +0 -74
- package/src/components/Report/LinearReport.tsx +0 -71
- package/src/components/ReportBuilder/SourceViewPicker.tsx +0 -122
- package/src/components/ReportBuilder/legacyNotebook.chart.spec.ts +0 -77
- package/src/components/ReportBuilder/legacyNotebook.convert.spec.ts +0 -626
- package/src/components/ReportBuilder/legacyNotebook.read.spec.ts +0 -338
- package/src/components/ReportBuilder/legacyNotebook.ts +0 -1122
- package/src/components/ReportBuilder/useConversionConfirm.ts +0 -55
- package/src/components/legacy/Notebook.served.spec.tsx +0 -183
- /package/dist/components/{Notebook → legacy/malloynb}/runPlan.d.ts +0 -0
- /package/src/components/{Notebook → legacy/malloynb}/runPlan.spec.ts +0 -0
- /package/src/components/{Notebook → legacy/malloynb}/runPlan.ts +0 -0
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
|
-
act,
|
|
6
5
|
cleanup,
|
|
7
6
|
fireEvent,
|
|
8
7
|
render,
|
|
@@ -10,13 +9,10 @@ import {
|
|
|
10
9
|
waitFor,
|
|
11
10
|
} from "@testing-library/react";
|
|
12
11
|
import { afterEach, describe, expect, it, mock } from "bun:test";
|
|
13
|
-
import * as fs from "fs";
|
|
14
|
-
import * as path from "path";
|
|
15
12
|
import { ReportBuilder } from "./ReportBuilder";
|
|
16
|
-
import { readForEditor } from "./readForEditor";
|
|
17
13
|
import { openDocument } from "./testing/fixtures";
|
|
18
14
|
import type { ReportEvent } from "../Report/telemetry";
|
|
19
|
-
import { editInline } from "./testing/inline";
|
|
15
|
+
import { editInline, viewOption } from "./testing/inline";
|
|
20
16
|
|
|
21
17
|
const NOTEBOOK = `## artifact { layout=linear title="Review" tiles=[intro { kind=text }, "a -> by_cat"] }
|
|
22
18
|
import "../data_app.malloy"
|
|
@@ -56,14 +52,6 @@ const catalog = {
|
|
|
56
52
|
],
|
|
57
53
|
};
|
|
58
54
|
|
|
59
|
-
const REPO = path.resolve(import.meta.dir, "../../../../..");
|
|
60
|
-
const LEGACY = fs
|
|
61
|
-
.readFileSync(
|
|
62
|
-
path.join(REPO, "examples/storefront/category-review.malloy"),
|
|
63
|
-
"utf8",
|
|
64
|
-
)
|
|
65
|
-
.replace(/\r\n/g, "\n");
|
|
66
|
-
|
|
67
55
|
const button = (name: string) =>
|
|
68
56
|
screen.getByRole("button", { name, hidden: true });
|
|
69
57
|
|
|
@@ -88,13 +76,22 @@ const mountText = async (
|
|
|
88
76
|
);
|
|
89
77
|
|
|
90
78
|
describe("ReportBuilder: a notebook is one column", () => {
|
|
91
|
-
it("draws its
|
|
79
|
+
it("draws its tiles as a grid does: query tiles in cards, text and description as prose", async () => {
|
|
80
|
+
// The layouts differ in arrangement only, not in how a tile is drawn.
|
|
92
81
|
await mountText(NOTEBOOK);
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
82
|
+
const tile = (name: string) =>
|
|
83
|
+
screen
|
|
84
|
+
.getByLabelText(`Tile ${name}`)
|
|
85
|
+
.querySelector("[data-chrome]")
|
|
86
|
+
?.getAttribute("data-chrome");
|
|
87
|
+
expect(tile("intro")).toBe("none");
|
|
88
|
+
expect(tile("by_cat")).toBe("card");
|
|
89
|
+
expect(
|
|
90
|
+
screen
|
|
91
|
+
.getByRole("group", { name: "Description" })
|
|
92
|
+
.querySelector("[data-chrome]")
|
|
93
|
+
?.getAttribute("data-chrome"),
|
|
94
|
+
).toBe("none");
|
|
98
95
|
});
|
|
99
96
|
|
|
100
97
|
it("offers no width: no resize edge, no width presets", async () => {
|
|
@@ -102,8 +99,8 @@ describe("ReportBuilder: a notebook is one column", () => {
|
|
|
102
99
|
expect(
|
|
103
100
|
screen.queryByRole("separator", { name: /^Width of / }),
|
|
104
101
|
).toBeNull();
|
|
105
|
-
|
|
106
|
-
expect(screen.
|
|
102
|
+
// A text tile has no menu; a query tile's offers no width.
|
|
103
|
+
expect(screen.queryByLabelText("Settings for intro")).toBeNull();
|
|
107
104
|
fireEvent.click(screen.getByLabelText("Settings for by_cat"));
|
|
108
105
|
expect(screen.queryByRole("button", { name: "Width ½" })).toBeNull();
|
|
109
106
|
});
|
|
@@ -127,7 +124,7 @@ describe("ReportBuilder: a notebook is one column", () => {
|
|
|
127
124
|
});
|
|
128
125
|
fireEvent.click(button("Add tile"));
|
|
129
126
|
expect(screen.queryByLabelText("Tile width")).toBeNull();
|
|
130
|
-
fireEvent.click(
|
|
127
|
+
fireEvent.click(viewOption("sales_by_state"));
|
|
131
128
|
fireEvent.click(screen.getByRole("button", { name: "Add tile" }));
|
|
132
129
|
fireEvent.click(button("Save"));
|
|
133
130
|
await waitFor(() => expect(written).toBeDefined());
|
|
@@ -140,14 +137,18 @@ describe("ReportBuilder: a notebook is one column", () => {
|
|
|
140
137
|
await mountText(NOTEBOOK, { withCatalog: true });
|
|
141
138
|
fireEvent.click(button("Add tile"));
|
|
142
139
|
expect(
|
|
143
|
-
screen.getByText(
|
|
140
|
+
screen.getByText(
|
|
141
|
+
"Pick a view from this package. You can change its title and chart now or later.",
|
|
142
|
+
),
|
|
144
143
|
).toBeDefined();
|
|
145
144
|
cleanup();
|
|
146
145
|
|
|
147
146
|
await mountText(DASHBOARD, { withCatalog: true });
|
|
148
147
|
fireEvent.click(button("Add tile"));
|
|
149
148
|
expect(
|
|
150
|
-
screen.getByText(
|
|
149
|
+
screen.getByText(
|
|
150
|
+
"Pick a view from this package. You can change its title and chart now or later.",
|
|
151
|
+
),
|
|
151
152
|
).toBeDefined();
|
|
152
153
|
});
|
|
153
154
|
|
|
@@ -160,8 +161,7 @@ describe("ReportBuilder: a notebook is one column", () => {
|
|
|
160
161
|
},
|
|
161
162
|
});
|
|
162
163
|
fireEvent.click(screen.getByLabelText("Insert tile after intro"));
|
|
163
|
-
fireEvent.click(screen.getByRole("button", { name: "
|
|
164
|
-
fireEvent.click(screen.getByRole("button", { name: "Add text" }));
|
|
164
|
+
fireEvent.click(screen.getByRole("button", { name: "Add text instead" }));
|
|
165
165
|
fireEvent.click(button("Save"));
|
|
166
166
|
await waitFor(() => expect(written).toBeDefined());
|
|
167
167
|
expect(written).toContain(
|
|
@@ -180,8 +180,7 @@ describe("ReportBuilder: a notebook is one column", () => {
|
|
|
180
180
|
fireEvent.click(screen.getByLabelText("Insert tile after intro"));
|
|
181
181
|
fireEvent.keyDown(screen.getByRole("dialog"), { key: "Escape" });
|
|
182
182
|
fireEvent.click(screen.getByLabelText("Add tile at the end"));
|
|
183
|
-
fireEvent.click(screen.getByRole("button", { name: "
|
|
184
|
-
fireEvent.click(screen.getByRole("button", { name: "Add text" }));
|
|
183
|
+
fireEvent.click(screen.getByRole("button", { name: "Add text instead" }));
|
|
185
184
|
fireEvent.click(button("Save"));
|
|
186
185
|
await waitFor(() => expect(written).toBeDefined());
|
|
187
186
|
expect(written).toContain(
|
|
@@ -219,93 +218,3 @@ describe("ReportBuilder: a document's kind", () => {
|
|
|
219
218
|
expect(screen.queryByLabelText("Show as")).toBeNull();
|
|
220
219
|
});
|
|
221
220
|
});
|
|
222
|
-
|
|
223
|
-
describe("ReportBuilder: a notebook in the cell format", () => {
|
|
224
|
-
const open = async (
|
|
225
|
-
options: {
|
|
226
|
-
onSave?: (source: string) => void;
|
|
227
|
-
onEvent?: (event: ReportEvent) => void;
|
|
228
|
-
onDirtyChange?: (dirty: boolean) => void;
|
|
229
|
-
} = {},
|
|
230
|
-
) => {
|
|
231
|
-
const result = await readForEditor(LEGACY);
|
|
232
|
-
if (result.ok === false) throw new Error(result.reason);
|
|
233
|
-
if (!result.conversion) throw new Error("expected a conversion");
|
|
234
|
-
render(
|
|
235
|
-
<ReportBuilder
|
|
236
|
-
source={LEGACY}
|
|
237
|
-
document={result.document}
|
|
238
|
-
conversion={result.conversion}
|
|
239
|
-
{...options}
|
|
240
|
-
/>,
|
|
241
|
-
);
|
|
242
|
-
return result.conversion;
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
it("opens unsaved, says what Save does, and is not edited", async () => {
|
|
246
|
-
const onDirtyChange = mock((_dirty: boolean) => {});
|
|
247
|
-
await open({ onSave: () => {}, onDirtyChange });
|
|
248
|
-
expect(
|
|
249
|
-
screen.getByText(
|
|
250
|
-
/This report is in the cell format\. Saving rewrites it as a layout notebook, and a named query run once becomes that tile's view\./,
|
|
251
|
-
),
|
|
252
|
-
).toBeDefined();
|
|
253
|
-
expect(button("Save")).toBeDefined();
|
|
254
|
-
// Each tile says why it has no preview yet, beside the view it will run.
|
|
255
|
-
expect(
|
|
256
|
-
screen.getAllByText("Preview appears after you Save"),
|
|
257
|
-
).toHaveLength(3);
|
|
258
|
-
expect(
|
|
259
|
-
screen.getByText("order_items_tiles → revenue_by_month"),
|
|
260
|
-
).toBeDefined();
|
|
261
|
-
// No edit has been made, so a host guarding navigation is told so.
|
|
262
|
-
expect(onDirtyChange).toHaveBeenLastCalledWith(false);
|
|
263
|
-
});
|
|
264
|
-
|
|
265
|
-
it("asks before Save converts the file, and writes it once confirmed", async () => {
|
|
266
|
-
const writes: string[] = [];
|
|
267
|
-
await open({ onSave: (source) => void writes.push(source) });
|
|
268
|
-
fireEvent.click(button("Save"));
|
|
269
|
-
expect(
|
|
270
|
-
await screen.findByText(
|
|
271
|
-
/Saving rewrites this report in the tile layout/,
|
|
272
|
-
),
|
|
273
|
-
).toBeDefined();
|
|
274
|
-
expect(writes).toHaveLength(0);
|
|
275
|
-
fireEvent.click(button("Convert and save"));
|
|
276
|
-
await waitFor(() => expect(writes).toHaveLength(1));
|
|
277
|
-
});
|
|
278
|
-
|
|
279
|
-
it("writes nothing when the conversion is cancelled", async () => {
|
|
280
|
-
const writes: string[] = [];
|
|
281
|
-
await open({ onSave: (source) => void writes.push(source) });
|
|
282
|
-
fireEvent.click(button("Save"));
|
|
283
|
-
fireEvent.click(await screen.findByRole("button", { name: "Cancel" }));
|
|
284
|
-
await act(async () => {});
|
|
285
|
-
expect(writes).toHaveLength(0);
|
|
286
|
-
expect(button("Save")).toBeDefined();
|
|
287
|
-
});
|
|
288
|
-
|
|
289
|
-
it("saves the conversion exactly as converted", async () => {
|
|
290
|
-
const writes: string[] = [];
|
|
291
|
-
const onEvent = mock((_event: ReportEvent) => {});
|
|
292
|
-
const conversion = await open({
|
|
293
|
-
onSave: (source) => void writes.push(source),
|
|
294
|
-
onEvent,
|
|
295
|
-
});
|
|
296
|
-
fireEvent.click(button("Save"));
|
|
297
|
-
fireEvent.click(
|
|
298
|
-
await screen.findByRole("button", { name: "Convert and save" }),
|
|
299
|
-
);
|
|
300
|
-
await waitFor(() => expect(writes).toHaveLength(1));
|
|
301
|
-
// Nothing was edited, so the file written is the conversion itself.
|
|
302
|
-
expect(writes[0]).toBe(conversion.to);
|
|
303
|
-
expect(onEvent.mock.calls[0][0]).toMatchObject({
|
|
304
|
-
type: "report.saved",
|
|
305
|
-
converted: true,
|
|
306
|
-
});
|
|
307
|
-
expect(
|
|
308
|
-
screen.queryByText(/This report is in the cell format/),
|
|
309
|
-
).toBeNull();
|
|
310
|
-
});
|
|
311
|
-
});
|
|
@@ -59,25 +59,28 @@ describe("ReportBuilder: an open inline draft", () => {
|
|
|
59
59
|
const onSave = mock(async (_source: string) => {});
|
|
60
60
|
await mount({ onSave, onDirtyChange });
|
|
61
61
|
type(openDescription(), "Committed");
|
|
62
|
-
fireEvent.
|
|
62
|
+
fireEvent.keyDown(screen.getByLabelText("Markdown"), {
|
|
63
|
+
key: "Enter",
|
|
64
|
+
metaKey: true,
|
|
65
|
+
});
|
|
63
66
|
fireEvent.click(button("Save"));
|
|
64
67
|
await waitFor(() => expect(button("Saved")).toBeDefined());
|
|
65
68
|
expect(onSave).toHaveBeenCalledTimes(1);
|
|
66
69
|
expect(onDirtyChange.mock.calls.at(-1)?.[0]).toBe(false);
|
|
67
70
|
});
|
|
68
71
|
|
|
69
|
-
it("reports the draft through onDirtyChange, and clears it on
|
|
72
|
+
it("reports the draft through onDirtyChange, and clears it on Escape", async () => {
|
|
70
73
|
const onDirtyChange = mock((_dirty: boolean) => {});
|
|
71
74
|
await mount({ onDirtyChange, onSave: async () => {} });
|
|
72
75
|
expect(onDirtyChange.mock.calls.at(-1)?.[0]).toBe(false);
|
|
73
76
|
type(openDescription(), "Half-typed");
|
|
74
77
|
expect(onDirtyChange.mock.calls.at(-1)?.[0]).toBe(true);
|
|
75
|
-
fireEvent.
|
|
78
|
+
fireEvent.keyDown(screen.getByLabelText("Markdown"), { key: "Escape" });
|
|
76
79
|
expect(onDirtyChange.mock.calls.at(-1)?.[0]).toBe(false);
|
|
77
80
|
});
|
|
78
81
|
|
|
79
82
|
// Outside act and with only microtasks drained, so work React defers to a later task does not count; a host's leave guard reads this flag in the very next task.
|
|
80
|
-
it("has told the host the draft is gone by the end of the
|
|
83
|
+
it("has told the host the draft is gone by the end of the Escape key", async () => {
|
|
81
84
|
const onDirtyChange = mock((_dirty: boolean) => {});
|
|
82
85
|
await mount({ onDirtyChange, onSave: async () => {} });
|
|
83
86
|
type(openDescription(), "Dropped");
|
|
@@ -86,7 +89,11 @@ describe("ReportBuilder: an open inline draft", () => {
|
|
|
86
89
|
const env = globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean };
|
|
87
90
|
env.IS_REACT_ACT_ENVIRONMENT = false;
|
|
88
91
|
try {
|
|
89
|
-
|
|
92
|
+
screen
|
|
93
|
+
.getByLabelText("Markdown")
|
|
94
|
+
.dispatchEvent(
|
|
95
|
+
new KeyboardEvent("keydown", { key: "Escape", bubbles: true }),
|
|
96
|
+
);
|
|
90
97
|
await new Promise<void>((resolve) => queueMicrotask(resolve));
|
|
91
98
|
expect(onDirtyChange.mock.calls.at(-1)?.[0]).toBe(false);
|
|
92
99
|
} finally {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// Copyright (c) Credible Data Inc.
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
|
|
4
|
+
import { viewOption } from "./testing/inline";
|
|
4
5
|
import {
|
|
5
6
|
cleanup,
|
|
6
7
|
fireEvent,
|
|
7
8
|
render,
|
|
8
9
|
screen,
|
|
9
10
|
waitFor,
|
|
10
|
-
within,
|
|
11
11
|
} from "@testing-library/react";
|
|
12
12
|
import { afterEach, describe, expect, it } from "bun:test";
|
|
13
13
|
import { ReportBuilder } from "./ReportBuilder";
|
|
@@ -63,15 +63,7 @@ const addTileOn = (name: string) => {
|
|
|
63
63
|
fireEvent.click(
|
|
64
64
|
screen.getByRole("button", { name: "Add tile", hidden: true }),
|
|
65
65
|
);
|
|
66
|
-
fireEvent.
|
|
67
|
-
screen.getByRole("combobox", { name: /Source/, hidden: true }),
|
|
68
|
-
);
|
|
69
|
-
fireEvent.click(
|
|
70
|
-
within(
|
|
71
|
-
screen.getAllByRole("listbox", { hidden: true }).at(-1)!,
|
|
72
|
-
).getByRole("option", { name: new RegExp(`^${name}`), hidden: true }),
|
|
73
|
-
);
|
|
74
|
-
fireEvent.click(screen.getByLabelText("View by_x"));
|
|
66
|
+
fireEvent.click(viewOption("by_x", name));
|
|
75
67
|
fireEvent.click(
|
|
76
68
|
screen.getByRole("button", { name: "Add tile", hidden: false }),
|
|
77
69
|
);
|
|
@@ -13,7 +13,7 @@ import { describe, expect, it, mock } from "bun:test";
|
|
|
13
13
|
import type { ReportEvent } from "../Report/telemetry";
|
|
14
14
|
import { ReportBuilder } from "./ReportBuilder";
|
|
15
15
|
import { openDocument } from "./testing/fixtures";
|
|
16
|
-
import { closeMenu, editInline } from "./testing/inline";
|
|
16
|
+
import { closeMenu, editInline, viewOption } from "./testing/inline";
|
|
17
17
|
import { dragEdge } from "./testing/resize";
|
|
18
18
|
|
|
19
19
|
const SOURCE = `## artifact { title="Storefront" tiles=["a -> by_cat", "a -> by_brand"] } dashboard { columns=12 }
|
|
@@ -428,21 +428,22 @@ describe("ReportBuilder: fields, when the package is known", () => {
|
|
|
428
428
|
fireEvent.change(screen.getByLabelText("Field to filter"), {
|
|
429
429
|
target: { value: "sale_price" },
|
|
430
430
|
});
|
|
431
|
-
const kind = (
|
|
431
|
+
const kind = (name: string) =>
|
|
432
|
+
within(
|
|
433
|
+
screen.getByRole("radiogroup", { name: "Filter kind" }),
|
|
434
|
+
).getByRole("radio", { name });
|
|
432
435
|
const submit = () =>
|
|
433
436
|
screen.getByRole("button", { name: "Add filter", hidden: false });
|
|
434
|
-
expect(kind().
|
|
437
|
+
expect(kind("Number range").getAttribute("aria-checked")).toBe("true");
|
|
435
438
|
expect(submit()).toHaveProperty("disabled", false);
|
|
436
|
-
//
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
).toBeDefined();
|
|
442
|
-
expect(submit()).toHaveProperty("disabled", true);
|
|
439
|
+
// A kind the field cannot take is not on offer: listed, off, and why.
|
|
440
|
+
const pickOne = kind("Pick one");
|
|
441
|
+
expect(pickOne.getAttribute("aria-disabled")).toBe("true");
|
|
442
|
+
fireEvent.click(pickOne);
|
|
443
|
+
expect(kind("Number range").getAttribute("aria-checked")).toBe("true");
|
|
443
444
|
});
|
|
444
445
|
|
|
445
|
-
it("marks a control whose binding names a missing field, on its
|
|
446
|
+
it("marks a control whose binding names a missing field, on its filter button", async () => {
|
|
446
447
|
const source = SOURCE.replace(
|
|
447
448
|
"where: cat ~ $CATEGORY",
|
|
448
449
|
"where: catgory ~ $CATEGORY",
|
|
@@ -455,8 +456,10 @@ describe("ReportBuilder: fields, when the package is known", () => {
|
|
|
455
456
|
catalog={catalog}
|
|
456
457
|
/>,
|
|
457
458
|
);
|
|
458
|
-
const
|
|
459
|
-
expect(
|
|
459
|
+
const button = screen.getByLabelText("Edit filter CATEGORY");
|
|
460
|
+
expect(
|
|
461
|
+
button.closest("[data-filter]")?.getAttribute("data-problem"),
|
|
462
|
+
).toBe("true");
|
|
460
463
|
});
|
|
461
464
|
});
|
|
462
465
|
|
|
@@ -521,7 +524,7 @@ describe("ReportBuilder: tiles added and removed", () => {
|
|
|
521
524
|
written = source;
|
|
522
525
|
});
|
|
523
526
|
fireEvent.click(button("Add tile"));
|
|
524
|
-
fireEvent.click(
|
|
527
|
+
fireEvent.click(viewOption("sales_by_state"));
|
|
525
528
|
fireEvent.change(screen.getByLabelText("Tile title"), {
|
|
526
529
|
target: { value: "Revenue by state" },
|
|
527
530
|
});
|
|
@@ -540,13 +543,15 @@ describe("ReportBuilder: tiles added and removed", () => {
|
|
|
540
543
|
);
|
|
541
544
|
});
|
|
542
545
|
|
|
543
|
-
it("removes a tile from its
|
|
546
|
+
it("removes a tile from the × on its corner, and saves it at once", async () => {
|
|
544
547
|
let written: string | undefined;
|
|
545
548
|
await mountWithCatalog((source) => {
|
|
546
549
|
written = source;
|
|
547
550
|
});
|
|
551
|
+
// Not from its menu: the menu holds the chart and drill only.
|
|
548
552
|
fireEvent.click(screen.getByLabelText("Settings for By category"));
|
|
549
|
-
|
|
553
|
+
expect(screen.queryByRole("button", { name: "Delete" })).toBeNull();
|
|
554
|
+
fireEvent.click(screen.getByLabelText("Remove By category"));
|
|
550
555
|
expect(screen.queryByLabelText("Tile by_cat")).toBeNull();
|
|
551
556
|
|
|
552
557
|
fireEvent.click(
|
|
@@ -565,15 +570,13 @@ describe("ReportBuilder: tiles added and removed", () => {
|
|
|
565
570
|
describe("ReportBuilder: the last tile", () => {
|
|
566
571
|
it("cannot be removed while the saved dashboard has tiles, and says why on screen", async () => {
|
|
567
572
|
await mount();
|
|
568
|
-
fireEvent.click(screen.getByLabelText("
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
const remove = screen.getByRole("button", { name: /^Delete/ });
|
|
573
|
+
fireEvent.click(screen.getByLabelText("Remove By category"));
|
|
574
|
+
// The last tile's × stays focusable, says why, and does nothing.
|
|
575
|
+
const remove = screen.getByLabelText("Remove by_brand");
|
|
572
576
|
expect(remove.getAttribute("aria-disabled")).toBe("true");
|
|
573
|
-
|
|
577
|
+
expect(remove.getAttribute("aria-description")).toBe(
|
|
574
578
|
"A saved report needs at least one tile.",
|
|
575
579
|
);
|
|
576
|
-
expect(remove.getAttribute("aria-describedby")).toBe(reason.id);
|
|
577
580
|
fireEvent.click(remove);
|
|
578
581
|
expect(screen.getByLabelText("Tile by_brand")).toBeDefined();
|
|
579
582
|
});
|
|
@@ -655,8 +658,8 @@ describe("ReportBuilder: widths and the page's own settings", () => {
|
|
|
655
658
|
fireEvent.change(description, {
|
|
656
659
|
target: { value: "What sold, and where." },
|
|
657
660
|
});
|
|
658
|
-
//
|
|
659
|
-
fireEvent.keyDown(description, { key: "
|
|
661
|
+
// ⌘Enter finishes: the text commits.
|
|
662
|
+
fireEvent.keyDown(description, { key: "Enter", metaKey: true });
|
|
660
663
|
expect(screen.getByText("What sold, and where.")).toBeDefined();
|
|
661
664
|
|
|
662
665
|
editInline("Storefront", "Report title", "Storefront, weekly");
|
|
@@ -702,13 +705,17 @@ source: a is scoped_orders extend {
|
|
|
702
705
|
/>,
|
|
703
706
|
);
|
|
704
707
|
fireEvent.click(screen.getByLabelText("Settings for x"));
|
|
705
|
-
fireEvent.click(
|
|
708
|
+
fireEvent.click(
|
|
709
|
+
screen.getByRole("menuitem", {
|
|
710
|
+
name: /^Clickable cells/,
|
|
711
|
+
hidden: true,
|
|
712
|
+
}),
|
|
713
|
+
);
|
|
706
714
|
|
|
715
|
+
// Switched on, a cell opens this report; another is one more pick.
|
|
716
|
+
fireEvent.click(screen.getByLabelText("cat is clickable"));
|
|
707
717
|
fireEvent.mouseDown(
|
|
708
|
-
screen.getByRole("combobox", { name:
|
|
709
|
-
);
|
|
710
|
-
fireEvent.click(
|
|
711
|
-
screen.getByRole("option", { name: /This report/, hidden: true }),
|
|
718
|
+
screen.getByRole("combobox", { name: "Where cat goes", hidden: true }),
|
|
712
719
|
);
|
|
713
720
|
fireEvent.click(
|
|
714
721
|
screen.getByRole("option", { name: /regions/, hidden: true }),
|
|
@@ -716,7 +723,7 @@ source: a is scoped_orders extend {
|
|
|
716
723
|
fireEvent.keyDown(document.body, { key: "Escape" });
|
|
717
724
|
fireEvent.mouseDown(
|
|
718
725
|
screen.getByRole("combobox", {
|
|
719
|
-
name:
|
|
726
|
+
name: "Control cat sets",
|
|
720
727
|
hidden: true,
|
|
721
728
|
}),
|
|
722
729
|
);
|
|
@@ -740,7 +747,6 @@ source: a is scoped_orders extend {
|
|
|
740
747
|
await mount();
|
|
741
748
|
fireEvent.click(screen.getByLabelText("Settings for By category"));
|
|
742
749
|
expect(screen.queryByRole("button", { name: "Drill" })).toBeNull();
|
|
743
|
-
expect(button("Delete")).toBeDefined();
|
|
744
750
|
});
|
|
745
751
|
});
|
|
746
752
|
|
|
@@ -94,8 +94,7 @@ describe("ReportBuilder: text tiles", () => {
|
|
|
94
94
|
written = source;
|
|
95
95
|
});
|
|
96
96
|
fireEvent.click(button("Add tile"));
|
|
97
|
-
fireEvent.click(screen.getByRole("button", { name: "
|
|
98
|
-
fireEvent.click(screen.getByRole("button", { name: "Add text" }));
|
|
97
|
+
fireEvent.click(screen.getByRole("button", { name: "Add text instead" }));
|
|
99
98
|
expect(
|
|
100
99
|
within(tile("text_1")).getByText(TEXT_TILE_PLACEHOLDER),
|
|
101
100
|
).toBeDefined();
|
|
@@ -113,9 +112,22 @@ describe("ReportBuilder: text tiles", () => {
|
|
|
113
112
|
it("names each new text tile for the first free number", async () => {
|
|
114
113
|
await mount();
|
|
115
114
|
for (const expected of ["text_1", "text_2"]) {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
fireEvent.click(
|
|
115
|
+
// The page's own Add tile, which comes first: a window still closing
|
|
116
|
+
// from the last pass has an Add tile of its own.
|
|
117
|
+
fireEvent.click(
|
|
118
|
+
screen.getAllByRole("button", {
|
|
119
|
+
name: "Add tile",
|
|
120
|
+
hidden: true,
|
|
121
|
+
})[0]!,
|
|
122
|
+
);
|
|
123
|
+
fireEvent.click(
|
|
124
|
+
screen
|
|
125
|
+
.getAllByRole("button", {
|
|
126
|
+
name: "Add text instead",
|
|
127
|
+
hidden: true,
|
|
128
|
+
})
|
|
129
|
+
.at(-1)!,
|
|
130
|
+
);
|
|
119
131
|
expect(tile(expected)).toBeDefined();
|
|
120
132
|
}
|
|
121
133
|
});
|
|
@@ -125,13 +137,9 @@ describe("ReportBuilder: text tiles", () => {
|
|
|
125
137
|
await mount((source) => {
|
|
126
138
|
written = source;
|
|
127
139
|
});
|
|
128
|
-
|
|
129
|
-
expect(screen.queryByLabelText("
|
|
130
|
-
expect(screen.
|
|
131
|
-
expect(screen.queryByRole("button", { name: /^Width/ })).toBeNull();
|
|
132
|
-
fireEvent.keyDown(screen.getByRole("button", { name: "Delete" }), {
|
|
133
|
-
key: "Escape",
|
|
134
|
-
});
|
|
140
|
+
// No menu at all: a text tile is edited in place and removed from its ×.
|
|
141
|
+
expect(screen.queryByLabelText("Settings for intro")).toBeNull();
|
|
142
|
+
expect(screen.getByLabelText("Remove intro")).toBeDefined();
|
|
135
143
|
dragEdge("intro", 6);
|
|
136
144
|
|
|
137
145
|
fireEvent.click(button("Save"));
|
|
@@ -139,13 +147,12 @@ describe("ReportBuilder: text tiles", () => {
|
|
|
139
147
|
expect(written).toContain("intro { kind=text colspan=6 }");
|
|
140
148
|
});
|
|
141
149
|
|
|
142
|
-
it("removes a text tile from its
|
|
150
|
+
it("removes a text tile from its ×, block and entry together", async () => {
|
|
143
151
|
let written: string | undefined;
|
|
144
152
|
await mount((source) => {
|
|
145
153
|
written = source;
|
|
146
154
|
});
|
|
147
|
-
fireEvent.click(screen.getByLabelText("
|
|
148
|
-
fireEvent.click(screen.getByRole("button", { name: "Delete" }));
|
|
155
|
+
fireEvent.click(screen.getByLabelText("Remove intro"));
|
|
149
156
|
expect(screen.queryByLabelText("Tile intro")).toBeNull();
|
|
150
157
|
|
|
151
158
|
fireEvent.click(button("Save"));
|