Tests for groups, more test utils (#1669)

This commit is contained in:
Pete Hunt 2020-05-28 01:56:18 -07:00 committed by GitHub
parent 4f3bf79708
commit 56f8bc092d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 3300 additions and 302 deletions

View file

@ -11,7 +11,6 @@ import {
import { measureText, getFontString } from "../utils";
import { randomInteger, randomId } from "../random";
import { newElementWith } from "./mutateElement";
import nanoid from "nanoid";
import { getNewGroupIdsForDuplication } from "../groups";
type ElementConstructorOpts = {
@ -183,7 +182,7 @@ export const duplicateElement = <TElement extends Mutable<ExcalidrawElement>>(
editingGroupId,
(groupId) => {
if (!groupIdMapForOperation.has(groupId)) {
groupIdMapForOperation.set(groupId, nanoid());
groupIdMapForOperation.set(groupId, randomId());
}
return groupIdMapForOperation.get(groupId)!;
},