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