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 1307268 commit 1563f90
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions packages/dds/tree/src/test/shared-tree/undo.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ describe("Undo and redo", () => {
);
});

// TODO:#24414: Enable forkable revertibles tests to run on attached/detached mode.
it("clone list of revertibles", () => {
const view = createInitializedView();
const { undoStack } = createTestUndoRedoStacks(view.events);
Expand Down Expand Up @@ -707,6 +708,7 @@ describe("Undo and redo", () => {
assert.equal(forkedView.root.child?.propertyOne, 128);
});

// TODO:#24414: Enable forkable revertibles tests to run on attached/detached mode.
it("cloning list of disposed revertibles throws error", () => {
const view = createInitializedView();
const { undoStack } = createTestUndoRedoStacks(view.events);
Expand All @@ -724,11 +726,13 @@ describe("Undo and redo", () => {
assert.equal(revertible.status, RevertibleStatus.Disposed);
}

assert.throws(() => cloneRevertibles(batchedRevertibles, forkedView), {
message: "List of revertible should not contain disposed revertibles.",
});
assert.throws(
() => cloneRevertibles(batchedRevertibles, forkedView),
/List of revertible should not contain disposed revertibles./,
);
});

// TODO:#24414: Enable forkable revertibles tests to run on attached/detached mode.
it("cloning list of revertibles between views with different changes throws error", () => {
const viewA = createInitializedView();
const viewB = createInitializedView();
Expand All @@ -744,7 +748,10 @@ describe("Undo and redo", () => {
revertibles.push(revertible);
}

assert.throws(() => cloneRevertibles(revertibles, viewB), "Error: 0x576");
assert.throws(
() => cloneRevertibles(revertibles, viewB),
/Cannot clone revertible for a commit that is not present on the given branch./,
);
});
});

Expand Down

0 comments on commit 1563f90

Please sign in to comment.