Much more thorough tests! (#1053)

This commit is contained in:
Pete Hunt
2020-03-23 16:38:41 -07:00
committed by GitHub
parent d4ff5cb926
commit bd7856adf3
22 changed files with 11883 additions and 24 deletions

View File

@ -1,16 +1,18 @@
import { queries, buildQueries } from "@testing-library/react";
const _getAllByToolName = (container: HTMLElement, tool: string) => {
const toolMap: { [propKey: string]: string } = {
selection: "SelectionS, 1",
rectangle: "RectangleR, 2",
diamond: "DiamondD, 3",
ellipse: "EllipseE, 4",
arrow: "ArrowA, 5",
line: "Line — L, 6",
};
const toolMap = {
selection: "Selection — S, 1",
rectangle: "RectangleR, 2",
diamond: "DiamondD, 3",
ellipse: "EllipseE, 4",
arrow: "ArrowA, 5",
line: "LineL, 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);
};