|
|
|
@ -13,7 +13,7 @@ import {
|
|
|
|
|
FontFamilyValues,
|
|
|
|
|
ExcalidrawRectangleElement,
|
|
|
|
|
} from "../element/types";
|
|
|
|
|
import { getFontString, getUpdatedTimestamp } from "../utils";
|
|
|
|
|
import { getFontString, getUpdatedTimestamp, isTestEnv } from "../utils";
|
|
|
|
|
import { randomInteger, randomId } from "../random";
|
|
|
|
|
import { mutateElement, newElementWith } from "./mutateElement";
|
|
|
|
|
import { getNewGroupIdsForDuplication } from "../groups";
|
|
|
|
@ -369,7 +369,7 @@ export const duplicateElement = <TElement extends Mutable<ExcalidrawElement>>(
|
|
|
|
|
overrides?: Partial<TElement>,
|
|
|
|
|
): TElement => {
|
|
|
|
|
let copy: TElement = deepCopyElement(element);
|
|
|
|
|
if (process.env.NODE_ENV === "test") {
|
|
|
|
|
if (isTestEnv()) {
|
|
|
|
|
copy.id = `${copy.id}_copy`;
|
|
|
|
|
// `window.h` may not be defined in some unit tests
|
|
|
|
|
if (
|
|
|
|
|