Skip to content

Commit 71930c0

Browse files
committed
Clean up
1 parent 3d56e51 commit 71930c0

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

extension/src/pipeline/quickPick.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,11 @@ const formatFieldQuickPickValues = (
4646
}
4747

4848
const prevFileValue = formattedFields[file]
49-
formattedFields[file] = [
50-
...(typeof prevFileValue === 'string' ? [prevFileValue] : prevFileValue),
51-
key
52-
]
49+
if (typeof prevFileValue === 'string') {
50+
formattedFields[file] = [prevFileValue]
51+
}
52+
53+
;(formattedFields[file] as string[]).push(key)
5354
}
5455

5556
return formattedFields

extension/src/test/suite/pipeline/index.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,12 +309,14 @@ suite('Pipeline Test Suite', () => {
309309
expect(mockPickPlotConfiguration).to.be.calledOnce
310310
expect(mockAddPlotToDvcFile).not.to.be.called
311311

312-
mockPickPlotConfiguration.onSecondCall().resolves({
312+
const mockPlotConfig: PipelineQuickPick.PlotConfigData = {
313313
template: 'simple',
314314
title: 'Great Plot Name',
315-
x: { file: 'results.json', key: 'step' },
315+
x: { 'results.json': 'step' },
316316
y: { 'results.json': 'acc' }
317-
})
317+
}
318+
319+
mockPickPlotConfiguration.onSecondCall().resolves(mockPlotConfig)
318320

319321
await pipeline.addDataSeriesPlot()
320322

0 commit comments

Comments
 (0)