/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
import { expect } from "chai";
import { isSettingsDb, queryStringResourceNames, settingsWorkspaceDbName } from "../../workspace/SettingsDb";
describe("SettingsDb", () => {
    it("exports the fixed settings workspace db name", () => {
        expect(settingsWorkspaceDbName).to.equal("settings-db");
    });
    it("SettingsDbName matches the runtime constant literal", () => {
        const typedName = settingsWorkspaceDbName;
        expect(typedName).to.equal(settingsWorkspaceDbName);
    });
    it("SettingsDb constrains dbName to SettingsDbName", () => {
        const workspaceDb = {
            dbName: settingsWorkspaceDbName,
        };
        const settingsDb = workspaceDb;
        const typedName = settingsDb.dbName;
        expect(typedName).to.equal(settingsWorkspaceDbName);
    });
    it("isSettingsDb returns true only for settings db name", () => {
        const settingsDb = { dbName: settingsWorkspaceDbName };
        const nonSettingsDb = { dbName: "workspace-db" };
        expect(isSettingsDb(settingsDb)).to.equal(true);
        expect(isSettingsDb(nonSettingsDb)).to.equal(false);
    });
    it("queryStringResourceNames returns all string resource names", () => {
        const settingsDb = {
            dbName: settingsWorkspaceDbName,
            queryResources: ({ callback }) => callback(["a", "b", "c"]),
        };
        expect(queryStringResourceNames(settingsDb)).to.deep.equal(["a", "b", "c"]);
    });
});
//# sourceMappingURL=SettingsDb.test.js.map