mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Much more thorough tests! (#1053)
This commit is contained in:
parent
d4ff5cb926
commit
bd7856adf3
22 changed files with 11883 additions and 24 deletions
|
@ -1,16 +1,18 @@
|
|||
import { queries, buildQueries } from "@testing-library/react";
|
||||
|
||||
const _getAllByToolName = (container: HTMLElement, tool: string) => {
|
||||
const toolMap: { [propKey: string]: string } = {
|
||||
selection: "Selection — S, 1",
|
||||
rectangle: "Rectangle — R, 2",
|
||||
diamond: "Diamond — D, 3",
|
||||
ellipse: "Ellipse — E, 4",
|
||||
arrow: "Arrow — A, 5",
|
||||
line: "Line — L, 6",
|
||||
};
|
||||
const toolMap = {
|
||||
selection: "Selection — S, 1",
|
||||
rectangle: "Rectangle — R, 2",
|
||||
diamond: "Diamond — D, 3",
|
||||
ellipse: "Ellipse — E, 4",
|
||||
arrow: "Arrow — A, 5",
|
||||
line: "Line — L, 6",
|
||||
};
|
||||
|
||||
const toolTitle = toolMap[tool as string];
|
||||
export type ToolName = keyof typeof toolMap;
|
||||
|
||||
const _getAllByToolName = (container: HTMLElement, tool: string) => {
|
||||
const toolTitle = toolMap[tool as ToolName];
|
||||
return queries.getAllByTitle(container, toolTitle);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue