Skip to content

Commit

Permalink
Merge branch 'main' into add-authorize-to-pr-workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
mattseddon authored Oct 20, 2022
2 parents e4e23aa + ed51f26 commit 9c59ba3
Show file tree
Hide file tree
Showing 7 changed files with 3,980 additions and 0 deletions.
8 changes: 8 additions & 0 deletions extension/src/experiments/columns/model.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import deeplyNestedColumnsFixture from '../../test/fixtures/expShow/deeplyNested
import deeplyNestedOutputFixture from '../../test/fixtures/expShow/deeplyNested/output'
import dataTypesColumnsFixture from '../../test/fixtures/expShow/dataTypes/columns'
import dataTypesOutputFixture from '../../test/fixtures/expShow/dataTypes/output'
import survivalOutputFixture from '../../test/fixtures/expShow/survival/output'
import survivalColumnsFixture from '../../test/fixtures/expShow/survival/columns'
import { getConfigValue } from '../../vscode/config'

jest.mock('../../vscode/config')
Expand All @@ -38,6 +40,12 @@ describe('ColumnsModel', () => {
expect(model.getSelected()).toStrictEqual(columnsFixture)
})

it('should return the expected columns when given the survival output fixture', async () => {
const model = new ColumnsModel('', buildMockMemento())
await model.transformAndSet(survivalOutputFixture)
expect(model.getSelected()).toStrictEqual(survivalColumnsFixture)
})

it('should return the expected columns when given the deeply nested output fixture', async () => {
const model = new ColumnsModel('', buildMockMemento())
await model.transformAndSet(deeplyNestedOutputFixture)
Expand Down
10 changes: 10 additions & 0 deletions extension/src/experiments/model/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import { Experiment, ColumnType } from '../webview/contract'
import { definedAndNonEmpty } from '../../util/array'
import dataTypesRowsFixture from '../../test/fixtures/expShow/dataTypes/rows'
import dataTypesOutputFixture from '../../test/fixtures/expShow/dataTypes/output'
import survivalOutputFixture from '../../test/fixtures/expShow/survival/output'
import survivalRowsFixture from '../../test/fixtures/expShow/survival/rows'

import { ExperimentStatus } from '../../cli/dvc/contract'

jest.mock('vscode')
Expand Down Expand Up @@ -74,6 +77,13 @@ describe('ExperimentsModel', () => {
expect(model.getRowData()).toStrictEqual(rowsFixture)
})

it('should return the expected rows when given the survival fixture', () => {
const model = new ExperimentsModel('', buildMockMemento())
model.transformAndSet(survivalOutputFixture)

expect(model.getRowData()).toStrictEqual(survivalRowsFixture)
})

// eslint-disable-next-line sonarjs/cognitive-complexity
it('should handle a new dep file being introduced in the workspace', () => {
const newDep = join('data', '.ldb_workspace')
Expand Down
Loading

0 comments on commit 9c59ba3

Please sign in to comment.