fix: paste styles shortcut (#4886)

Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
This commit is contained in:
David Luzar 2022-03-09 10:59:44 +01:00 committed by GitHub
parent 1849ff6ee2
commit 20de06ef50
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 99 additions and 31 deletions

View file

@ -221,6 +221,14 @@ export class UI {
fireEvent.click(GlobalTestState.renderResult.getByToolName(toolName));
};
static clickLabeledElement = (label: string) => {
const element = document.querySelector(`[aria-label='${label}']`);
if (!element) {
throw new Error(`No labeled element found: ${label}`);
}
fireEvent.click(element);
};
/**
* Creates an Excalidraw element, and returns a proxy that wraps it so that
* accessing props will return the latest ones from the object existing in