Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve max table depth test #2621

Merged
merged 5 commits into from
Oct 18, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions extension/src/test/suite/experiments/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import { shortenForLabel } from '../../../util/string'
import { GitExecutor } from '../../../cli/git/executor'
import { WorkspacePlots } from '../../../plots/workspace'
import { RegisteredCommands } from '../../../commands/external'
import { ConfigKey } from '../../../vscode/config'

suite('Experiments Test Suite', () => {
const disposable = Disposable.fn()
Expand Down Expand Up @@ -172,6 +173,12 @@ suite('Experiments Test Suite', () => {
})

describe('handleMessageFromWebview', () => {
after(() => {
workspace
.getConfiguration(ConfigKey.EXP_TABLE_HEAD_MAX_DEPTH)
.update('', undefined, false)
})

const setupExperimentsAndMockCommands = () => {
const {
columnsModel,
Expand Down Expand Up @@ -883,9 +890,8 @@ suite('Experiments Test Suite', () => {
it('should be able to handle a message to update the table depth', async () => {
const { experiments } = buildExperiments(disposable, expShowFixture)
const inputEvent = getInputBoxEvent('0')
const tableMaxDepthOption = 'dvc.experimentsTableHeadMaxHeight'
const tableMaxDepthChanged = configurationChangeEvent(
tableMaxDepthOption,
ConfigKey.EXP_TABLE_HEAD_MAX_DEPTH,
disposable
)

Expand All @@ -901,7 +907,7 @@ suite('Experiments Test Suite', () => {
await tableMaxDepthChanged

expect(
await workspace.getConfiguration().get(tableMaxDepthOption)
workspace.getConfiguration().get(ConfigKey.EXP_TABLE_HEAD_MAX_DEPTH)
).to.equal(0)
expect(mockSendTelemetryEvent).to.be.called
expect(
Expand Down