/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { strict as assert } from "node:assert";
import { UniversalSequenceNumber } from "../constants.js";
import { reservedMarkerIdKey } from "../mergeTreeNodes.js";
import { ReferenceType } from "../ops.js";
import { TextSegment } from "../textSegment.js";
import { TestClient } from "./testClient.js";
import { insertSegments } from "./testUtils.js";
describe("TestClient", () => {
    const localUserLongId = "localUser";
    let client;
    beforeEach(() => {
        client = new TestClient();
        insertSegments({
            mergeTree: client.mergeTree,
            pos: 0,
            segments: [TextSegment.make("")],
            refSeq: UniversalSequenceNumber,
            clientId: client.getClientId(),
            seq: UniversalSequenceNumber,
            opArgs: undefined,
        });
        client.startOrUpdateCollaboration(localUserLongId);
    });
    describe(".annotateMarker", () => {
        it("annotate valid marker", () => {
            const insertOp = client.insertMarkerLocal(0, ReferenceType.Tile, {
                [reservedMarkerIdKey]: "123",
            });
            assert(insertOp);
            const markerInfo = client.getContainingSegment(0);
            const marker = markerInfo.segment;
            const annotateOp = client.annotateMarker(marker, { foo: "bar" });
            assert(annotateOp);
            assert(marker.properties);
            assert(marker.properties.foo, "bar");
        });
    });
});
//# sourceMappingURL=client.annotateMarker.spec.js.map