mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Add stats for nerds (#2453)
Co-authored-by: David Luzar <luzar.david@gmail.com> Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
parent
5cdb9bd2ed
commit
dd993adc5c
15 changed files with 361 additions and 33 deletions
|
@ -1,23 +1,23 @@
|
|||
import { reseed } from "../random";
|
||||
import { queryByText } from "@testing-library/react";
|
||||
import React from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
import { copiedStyles } from "../actions/actionStyles";
|
||||
import { ExcalidrawElement } from "../element/types";
|
||||
import { setLanguage, t } from "../i18n";
|
||||
import { CODES, KEYS } from "../keys";
|
||||
import Excalidraw from "../packages/excalidraw/index";
|
||||
import { reseed } from "../random";
|
||||
import * as Renderer from "../renderer/renderScene";
|
||||
import { setDateTimeForTests } from "../utils";
|
||||
import { API } from "./helpers/api";
|
||||
import { Keyboard, Pointer, UI } from "./helpers/ui";
|
||||
import {
|
||||
waitFor,
|
||||
render,
|
||||
screen,
|
||||
fireEvent,
|
||||
GlobalTestState,
|
||||
render,
|
||||
screen,
|
||||
waitFor,
|
||||
} from "./test-utils";
|
||||
import Excalidraw from "../packages/excalidraw/index";
|
||||
import { setLanguage } from "../i18n";
|
||||
import { setDateTimeForTests } from "../utils";
|
||||
import { ExcalidrawElement } from "../element/types";
|
||||
import { queryByText } from "@testing-library/react";
|
||||
import { copiedStyles } from "../actions/actionStyles";
|
||||
import { UI, Pointer, Keyboard } from "./helpers/ui";
|
||||
import { API } from "./helpers/api";
|
||||
import { CODES, KEYS } from "../keys";
|
||||
|
||||
const { h } = window;
|
||||
|
||||
|
@ -633,10 +633,14 @@ describe("regression tests", () => {
|
|||
});
|
||||
const contextMenu = document.querySelector(".context-menu");
|
||||
const options = contextMenu?.querySelectorAll(".context-menu-option");
|
||||
const expectedOptions = ["Select all", "Toggle grid mode"];
|
||||
const expectedOptions = [
|
||||
t("labels.selectAll"),
|
||||
t("labels.toggleGridMode"),
|
||||
t("labels.toggleStats"),
|
||||
];
|
||||
|
||||
expect(contextMenu).not.toBeNull();
|
||||
expect(options?.length).toBe(2);
|
||||
expect(options?.length).toBe(3);
|
||||
expect(options?.item(0).textContent).toBe(expectedOptions[0]);
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue