feat: release design system engine, studio and component contracts
This commit is contained in:
1 parent
ff1065fb27
commit
3943b946d6
693 files changed
+175546
-3894
No files matched your search
@@ -3,10 +3,16 @@ import { Window } from "happy-dom";
|
||||
import { showBuilderBlockActions } from "../src/live-canvas.ts";
|
||||
|
||||
test("compact selection actions retain accessible names and callbacks without interpreting labels", () => {
|
||||
const window = new Window(), document = window.document;
|
||||
const window = new Window(),
|
||||
document = window.document;
|
||||
document.body.innerHTML = '<div data-block-id="text">Content</div>';
|
||||
let calls = 0;
|
||||
showBuilderBlockActions(document as unknown as Document, "text", "Text — <script>example</script>", { Edit: () => calls++, Delete: () => calls++ });
|
||||
showBuilderBlockActions(
|
||||
document as unknown as Document,
|
||||
"text",
|
||||
"Text — <script>example</script>",
|
||||
{ Edit: () => calls++, Delete: () => calls++ },
|
||||
);
|
||||
const toolbar = document.querySelector('[role="toolbar"]')!;
|
||||
expect(toolbar.getAttribute("aria-label")).toBe("Text — <script>example</script> actions");
|
||||
expect(toolbar.querySelector("strong")?.textContent).toBe("Text");
|
||||
|
||||
Reference in new issue
Block a user