From dbcbe286e755754dcac4839cc3b8970c354f3b94 Mon Sep 17 00:00:00 2001 From: Chen-I Lim Date: Thu, 15 Oct 2020 19:36:49 -0700 Subject: [PATCH] Test: randomize icons --- src/client/components/boardComponent.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/client/components/boardComponent.tsx b/src/client/components/boardComponent.tsx index ac9bc5ed0..7359b0a5f 100644 --- a/src/client/components/boardComponent.tsx +++ b/src/client/components/boardComponent.tsx @@ -265,6 +265,7 @@ class BoardComponent extends React.Component { { id: "exportBoardArchive", name: "Export board archive" }, { id: "testAdd100Cards", name: "TEST: Add 100 cards" }, { id: "testAdd1000Cards", name: "TEST: Add 1,000 cards" }, + { id: "testRandomizeIcons", name: "TEST: Randomize icons" }, ] OldMenu.shared.onMenuClicked = async (id: string) => { @@ -281,6 +282,10 @@ class BoardComponent extends React.Component { this.testAddCards(1000) break } + case "testRandomizeIcons": { + this.testRandomizeIcons() + break + } } } OldMenu.shared.showAtElement(e.target as HTMLElement) @@ -309,6 +314,14 @@ class BoardComponent extends React.Component { } } + private async testRandomizeIcons() { + const { boardTree } = this.props + + for (const card of boardTree.cards) { + mutator.changeIcon(card, BlockIcons.shared.randomIcon(), "randomize icon") + } + } + private async propertiesClicked(e: React.MouseEvent) { const { boardTree } = this.props const { activeView } = boardTree