mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Tests for groups, more test utils (#1669)
This commit is contained in:
parent
4f3bf79708
commit
56f8bc092d
4 changed files with 3300 additions and 302 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue