feat: Add prop UIOptions.canvasActions.saveAsImage to show/hide save image button (#3662)

* feat: Add prop UIOptions.canvasActions.saveAsImage which implies whether the save as image dialog should be shown

* Add docs

* fix specs
This commit is contained in:
Aakansha Doshi 2021-05-29 19:41:50 +05:30 committed by GitHub
parent 716c78e930
commit 360310de31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 1 deletions

View file

@ -167,6 +167,13 @@ describe("<Excalidraw/>", () => {
);
expect(queryByTestId(container, "json-export-button")).toBeNull();
});
it("should hide 'Save as image' button when 'saveAsImage' is false", async () => {
const { container } = await render(
<Excalidraw UIOptions={{ canvasActions: { saveAsImage: false } }} />,
);
expect(queryByTestId(container, "image-export-button")).toBeNull();
});