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

@ -1,6 +1,5 @@
import { KEYS } from "../keys";
import { register } from "./register";
import nanoid from "nanoid";
import { newElementWith } from "../element/mutateElement";
import { getSelectedElements } from "../scene";
import {
@ -13,6 +12,7 @@ import {
isElementInGroup,
} from "../groups";
import { getNonDeletedElements } from "../element";
import { randomId } from "../random";
export const actionGroup = register({
name: "group",
@ -46,7 +46,7 @@ export const actionGroup = register({
return { appState, elements, commitToHistory: false };
}
}
const newGroupId = nanoid();
const newGroupId = randomId();
const updatedElements = elements.map((element) => {
if (!appState.selectedElementIds[element.id]) {
return element;