From 274569f7e8fa1bb9c0b3883d862728008f5e3189 Mon Sep 17 00:00:00 2001 From: julieg18 Date: Thu, 21 Sep 2023 12:06:07 -0500 Subject: [PATCH] Fix tests breaking due to new columns --- extension/src/test/fixtures/expShow/base/columns.ts | 2 ++ .../src/test/suite/experiments/columns/tree.test.ts | 5 +++-- extension/src/test/suite/experiments/index.test.ts | 10 ++++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/extension/src/test/fixtures/expShow/base/columns.ts b/extension/src/test/fixtures/expShow/base/columns.ts index 6ffda369b1..93a882953b 100644 --- a/extension/src/test/fixtures/expShow/base/columns.ts +++ b/extension/src/test/fixtures/expShow/base/columns.ts @@ -10,6 +10,8 @@ const nestedParamsFile = join('nested', 'params.yaml') export const dataColumnOrder: string[] = [ 'id', + 'branch', + 'commit', 'Created', 'metrics:summary.json:accuracy', 'metrics:summary.json:loss', diff --git a/extension/src/test/suite/experiments/columns/tree.test.ts b/extension/src/test/suite/experiments/columns/tree.test.ts index 13ded49a0f..448e6b9fa1 100644 --- a/extension/src/test/suite/experiments/columns/tree.test.ts +++ b/extension/src/test/suite/experiments/columns/tree.test.ts @@ -363,8 +363,9 @@ suite('Experiments Columns Tree Test Suite', () => { const firstColumns = [] const otherColumns = [] + const defaultColumns = ['id', 'branch', 'commit'] for (const column of columnsOrder) { - if (column === 'id') { + if (defaultColumns.includes(column)) { continue } if ( @@ -410,7 +411,7 @@ suite('Experiments Columns Tree Test Suite', () => { ]) expect(columnsModel.getColumnOrder()).to.deep.equal([ - 'id', + ...defaultColumns, ...firstColumns, ...otherColumns ]) diff --git a/extension/src/test/suite/experiments/index.test.ts b/extension/src/test/suite/experiments/index.test.ts index 6c8c749023..688dd5d2f2 100644 --- a/extension/src/test/suite/experiments/index.test.ts +++ b/extension/src/test/suite/experiments/index.test.ts @@ -1096,9 +1096,12 @@ suite('Experiments Test Suite', () => { }) await messageSent - const [id, firstColumn] = messageSpy.lastCall.args[0].columnOrder + const [id, branch, commit, firstColumn] = + messageSpy.lastCall.args[0].columnOrder expect(id).to.equal('id') + expect(commit).to.equal('commit') + expect(branch).to.equal('branch') expect(firstColumn).to.equal(movedColumn) }).timeout(WEBVIEW_TEST_TIMEOUT) @@ -1126,8 +1129,11 @@ suite('Experiments Test Suite', () => { expect(paramsYamlColumns).to.be.greaterThan(6) - const [id, ...columns] = messageSpy.lastCall.args[0].columnOrder + const [id, branch, commit, ...columns] = + messageSpy.lastCall.args[0].columnOrder expect(id).to.equal('id') + expect(branch).to.equal('branch') + expect(commit).to.equal('commit') let params = 0 let other = 0