/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { SequenceField as SF } from "../../../feature-libraries/index.js";
import { brand } from "../../../util/index.js";
import { TestChange } from "../../testChange.js";
import { makeEncodingTestSuite, mintRevisionTag, testIdCompressor, testRevisionTagCodec, } from "../../utils.js";
import { generatePopulatedMarks } from "./populatedMarks.js";
import { ChangeMaker as Change, cases } from "./testEdits.js";
const sessionId = { originatorId: "session1" };
const encodingTestData = {
    successes: [
        ["with child change", Change.modify(1, TestChange.mint([], 1)), sessionId],
        ["without child change", Change.remove(2, 2), sessionId],
        [
            "with repair data",
            Change.revive(0, 1, { revision: mintRevisionTag(), localId: brand(10) }),
            sessionId,
        ],
        ...Object.entries(cases).map(([name, change]) => [name, change, sessionId]),
        ...generatePopulatedMarks(testIdCompressor).map((mark) => [
            "type" in mark ? mark.type : "NoOp",
            [mark],
            sessionId,
        ]),
    ],
};
export function testCodecs() {
    describe("Codecs", () => {
        makeEncodingTestSuite(SF.sequenceFieldChangeCodecFactory(TestChange.codec, testRevisionTagCodec), encodingTestData);
    });
}
//# sourceMappingURL=sequenceFieldCodecs.test.js.map