Extract dbConfigFilePath
This commit is contained in:
@@ -28,6 +28,8 @@ describe("Db panel UI commands", () => {
|
|||||||
// d) we depend on highlighted list items when adding a repo to a list. If there's not enough time in between, a test might think a list is highlighted that doesn't exist anymore
|
// d) we depend on highlighted list items when adding a repo to a list. If there's not enough time in between, a test might think a list is highlighted that doesn't exist anymore
|
||||||
|
|
||||||
let storagePath: string;
|
let storagePath: string;
|
||||||
|
let dbConfigFilePath: string;
|
||||||
|
|
||||||
const commandManager = createVSCodeCommandManager<AllCommands>();
|
const commandManager = createVSCodeCommandManager<AllCommands>();
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
@@ -35,6 +37,11 @@ describe("Db panel UI commands", () => {
|
|||||||
|
|
||||||
storagePath =
|
storagePath =
|
||||||
extension.ctx.storageUri?.fsPath || extension.ctx.globalStorageUri.fsPath;
|
extension.ctx.storageUri?.fsPath || extension.ctx.globalStorageUri.fsPath;
|
||||||
|
|
||||||
|
dbConfigFilePath = path.join(
|
||||||
|
storagePath,
|
||||||
|
DbConfigStore.databaseConfigFileName,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should add new remote db list", async () => {
|
it("should add new remote db list", async () => {
|
||||||
@@ -45,10 +52,6 @@ describe("Db panel UI commands", () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Check db config
|
// Check db config
|
||||||
const dbConfigFilePath = path.join(
|
|
||||||
storagePath,
|
|
||||||
DbConfigStore.databaseConfigFileName,
|
|
||||||
);
|
|
||||||
const dbConfig: DbConfig = await readJson(dbConfigFilePath);
|
const dbConfig: DbConfig = await readJson(dbConfigFilePath);
|
||||||
expect(dbConfig.databases.variantAnalysis.repositoryLists).toHaveLength(1);
|
expect(dbConfig.databases.variantAnalysis.repositoryLists).toHaveLength(1);
|
||||||
expect(dbConfig.databases.variantAnalysis.repositoryLists[0].name).toBe(
|
expect(dbConfig.databases.variantAnalysis.repositoryLists[0].name).toBe(
|
||||||
@@ -67,10 +70,6 @@ describe("Db panel UI commands", () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Check db config
|
// Check db config
|
||||||
const dbConfigFilePath = path.join(
|
|
||||||
storagePath,
|
|
||||||
DbConfigStore.databaseConfigFileName,
|
|
||||||
);
|
|
||||||
const dbConfig: DbConfig = await readJson(dbConfigFilePath);
|
const dbConfig: DbConfig = await readJson(dbConfigFilePath);
|
||||||
expect(dbConfig.databases.local.lists).toHaveLength(1);
|
expect(dbConfig.databases.local.lists).toHaveLength(1);
|
||||||
expect(dbConfig.databases.local.lists[0].name).toBe("my-list-1");
|
expect(dbConfig.databases.local.lists[0].name).toBe("my-list-1");
|
||||||
@@ -88,10 +87,6 @@ describe("Db panel UI commands", () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Check db config
|
// Check db config
|
||||||
const dbConfigFilePath = path.join(
|
|
||||||
storagePath,
|
|
||||||
DbConfigStore.databaseConfigFileName,
|
|
||||||
);
|
|
||||||
const dbConfig: DbConfig = await readJson(dbConfigFilePath);
|
const dbConfig: DbConfig = await readJson(dbConfigFilePath);
|
||||||
expect(dbConfig.databases.variantAnalysis.repositories).toHaveLength(1);
|
expect(dbConfig.databases.variantAnalysis.repositories).toHaveLength(1);
|
||||||
expect(dbConfig.databases.variantAnalysis.repositories[0]).toBe(
|
expect(dbConfig.databases.variantAnalysis.repositories[0]).toBe(
|
||||||
@@ -111,10 +106,6 @@ describe("Db panel UI commands", () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Check db config
|
// Check db config
|
||||||
const dbConfigFilePath = path.join(
|
|
||||||
storagePath,
|
|
||||||
DbConfigStore.databaseConfigFileName,
|
|
||||||
);
|
|
||||||
const dbConfig: DbConfig = await readJson(dbConfigFilePath);
|
const dbConfig: DbConfig = await readJson(dbConfigFilePath);
|
||||||
expect(dbConfig.databases.variantAnalysis.owners).toHaveLength(1);
|
expect(dbConfig.databases.variantAnalysis.owners).toHaveLength(1);
|
||||||
expect(dbConfig.databases.variantAnalysis.owners[0]).toBe("owner1");
|
expect(dbConfig.databases.variantAnalysis.owners[0]).toBe("owner1");
|
||||||
@@ -134,10 +125,6 @@ describe("Db panel UI commands", () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Check db config
|
// Check db config
|
||||||
const dbConfigFilePath = path.join(
|
|
||||||
storagePath,
|
|
||||||
DbConfigStore.databaseConfigFileName,
|
|
||||||
);
|
|
||||||
const dbConfig: DbConfig = await readJson(dbConfigFilePath);
|
const dbConfig: DbConfig = await readJson(dbConfigFilePath);
|
||||||
expect(dbConfig.selected).toBeDefined();
|
expect(dbConfig.selected).toBeDefined();
|
||||||
expect(dbConfig.selected).toEqual({
|
expect(dbConfig.selected).toEqual({
|
||||||
|
|||||||
Reference in New Issue
Block a user