"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
const chai_1 = require("chai");
const ecschema_rpcinterface_common_1 = require("@itwin/ecschema-rpcinterface-common");
const TestContext_1 = require("./setup/TestContext");
const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
describe("Schema RPC Interface", () => {
    let iModel;
    let testContext;
    before(async () => {
        testContext = await TestContext_1.TestContext.instance();
        iModel = await testContext.iModelWithChangesets.getConnection();
    });
    it("should get schema keys", async () => {
        const schemaKeys = [];
        const props = await ecschema_rpcinterface_common_1.ECSchemaRpcInterface.getClient().getSchemaKeys(iModel.getRpcProps());
        props.forEach((prop) => schemaKeys.push(ecschema_metadata_1.SchemaKey.fromJSON(prop)));
        (0, chai_1.expect)(schemaKeys).to.not.be.undefined;
    });
    it("should get schema JSON", async () => {
        const schemaKeys = [];
        const props = await ecschema_rpcinterface_common_1.ECSchemaRpcInterface.getClient().getSchemaKeys(iModel.getRpcProps());
        props.forEach((prop) => schemaKeys.push(ecschema_metadata_1.SchemaKey.fromJSON(prop)));
        const schemaJSON = await ecschema_rpcinterface_common_1.ECSchemaRpcInterface.getClient().getSchemaJSON(iModel.getRpcProps(), schemaKeys[0].name);
        (0, chai_1.expect)(schemaJSON).to.not.be.undefined;
    });
});
//# sourceMappingURL=SchemaRpcInterface.test.js.map