Skip to content

Commit

Permalink
change test
Browse files Browse the repository at this point in the history
  • Loading branch information
jikim-msft committed Jan 8, 2025
1 parent 1563f90 commit 90afd19
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions packages/dds/tree/src/test/shared-tree/undo.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import {
type FieldUpPath,
type Revertible,
type RevertibleAlpha,
cloneRevertibles,
RevertibleStatus,
type UpPath,
Expand Down Expand Up @@ -718,16 +717,15 @@ describe("Undo and redo", () => {
view.root.child.propertyTwo.itemOne = "newItem"; // "" -> "newItem"

const forkedView = view.fork();
const revertibles = [...undoStack];

const batchedRevertibles: RevertibleAlpha[] = [];
for (const revertible of undoStack) {
revertible.revert();
batchedRevertibles.push(revertible);
assert.equal(revertible.status, RevertibleStatus.Disposed);
}

assert.throws(
() => cloneRevertibles(batchedRevertibles, forkedView),
() => cloneRevertibles(revertibles, forkedView),
/List of revertible should not contain disposed revertibles./,
);
});
Expand All @@ -743,10 +741,7 @@ describe("Undo and redo", () => {
viewA.root.child.propertyOne = 256; // 128 -> 256
viewA.root.child.propertyTwo.itemOne = "newItem"; // "" -> "newItem"

const revertibles: RevertibleAlpha[] = [];
for (const revertible of undoStack) {
revertibles.push(revertible);
}
const revertibles = [...undoStack];

assert.throws(
() => cloneRevertibles(revertibles, viewB),
Expand Down

0 comments on commit 90afd19

Please sign in to comment.