Skip to content

Commit

Permalink
unskip end to end chunk insert op test (#19026)
Browse files Browse the repository at this point in the history
## Description

This PR unskips the end to end chunk insert op test, as it is now
working due to [PR
19009](#19009).
  • Loading branch information
daesunp authored Jan 3, 2024
1 parent f21de88 commit d45a11d
Showing 1 changed file with 4 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
ChangesetLocalId,
IEditableForest,
TreeStoredSchemaRepository,
mapCursorField,
} from "../../../core/index.js";
import { leaf } from "../../../domains/index.js";
import { typeboxValidator } from "../../../external-utilities/index.js";
Expand All @@ -22,12 +21,10 @@ import {
TreeCompressionStrategy,
buildChunkedForest,
createMockNodeKeyManager,
cursorForMapTreeNode,
defaultSchemaPolicy,
getTreeContext,
intoStoredSchema,
makeFieldBatchCodec,
mapTreeFromCursor,
nodeKeyFieldKey,
} from "../../../feature-libraries/index.js";
// eslint-disable-next-line import/no-internal-modules
Expand Down Expand Up @@ -59,10 +56,7 @@ const fieldBatchCodec = makeFieldBatchCodec({ jsonValidator: typeboxValidator },
const sessionId = "beefbeef-beef-4000-8000-000000000001" as SessionId;
const idCompressor = createIdCompressor(sessionId);

// TODO: Currently we split up a uniform chunk into several individual basicChunks for each node during op creation.
// Therefore, there is currently no way for us to retrieve a uniform chunk from the tree for us to make the proper checks,
// and the tests are expected to fail. The tests can be unskipped once uniform chunks can be inserted into the tree.
describe.skip("End to End chunked encoding", () => {
describe("End to end chunked encoding", () => {
it(`insert ops shares reference with the original chunk.`, () => {
const treeSchema = new TreeStoredSchemaRepository(
intoStoredSchema(numberSequenceRootSchema),
Expand Down Expand Up @@ -110,14 +104,12 @@ describe.skip("End to End chunked encoding", () => {
// Check that inserted change contains chunk which is reference equal to the original chunk.
const insertedChange = changeLog[0];
assert(insertedChange.builds !== undefined);
// TODO: This chunk is actually a BasicChunk which was split from the original UniformChunk split up.
// This is expected to fail currently, but should eventually pass once we have the ability to insert UniformChunk.
const insertedChunk = insertedChange.builds.get(undefined)?.get(0 as ChangesetLocalId);
assert.equal(insertedChunk, chunk);
assert(chunk.isShared());
});

it(`summary values are correct, and shares reference with the original chunk when inserting content.`, () => {
it.skip(`summary values are correct, and shares reference with the original chunk when inserting content.`, () => {
const numberShape = new TreeShape(leaf.number.name, true, []);
const chunk = new UniformChunk(numberShape.withTopLevelLength(4), [1, 2, 3, 4]);
assert(!chunk.isShared());
Expand Down Expand Up @@ -145,19 +137,14 @@ describe.skip("End to End chunked encoding", () => {
forestSummarizer.getAttachSummary(stringifier);
});

it(`summary values are correct, and shares reference with the original chunk when initializing with content.`, () => {
it.skip(`summary values are correct, and shares reference with the original chunk when initializing with content.`, () => {
const numberShape = new TreeShape(leaf.number.name, true, []);
const chunk = new UniformChunk(numberShape.withTopLevelLength(4), [1, 2, 3, 4]);
assert(!chunk.isShared());

const flexTree = flexTreeViewWithContent({
schema: numberSequenceRootSchema,
// TODO: Replace mapping of 'fieldCursor' to 'nodeCursors' with 'chunk.cursor()'
// once 'NewFieldContent' in 'contextuallyTyped.ts' supports 'fieldCursor'.
// Current implementation is a workaround for type limitations.
initialTree: mapCursorField(chunk.cursor(), (cursor) =>
cursorForMapTreeNode(mapTreeFromCursor(cursor)),
),
initialTree: chunk.cursor(),
});

const forestSummarizer = new ForestSummarizer(
Expand Down

0 comments on commit d45a11d

Please sign in to comment.