-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
268 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { pickPlotType } from './quickPick' | ||
import { quickPickValue } from '../vscode/quickPick' | ||
import { Title } from '../vscode/title' | ||
|
||
jest.mock('../vscode/quickPick') | ||
|
||
const mockedQuickPickValue = jest.mocked(quickPickValue) | ||
|
||
beforeEach(() => { | ||
jest.resetAllMocks() | ||
}) | ||
|
||
describe('pickPlotType', () => { | ||
it('should call a quick pick with possible plot types', async () => { | ||
mockedQuickPickValue.mockResolvedValueOnce(undefined) | ||
|
||
await pickPlotType() | ||
|
||
expect(mockedQuickPickValue).toHaveBeenCalledWith( | ||
[ | ||
{ | ||
description: | ||
'Create a data series plot definition by selecting data from a file', | ||
label: 'Data Series', | ||
value: 'data-series' | ||
}, | ||
{ | ||
description: | ||
'Create an extension-only plot by selecting one metric and one param from the experiments table', | ||
label: 'Custom', | ||
value: 'custom' | ||
} | ||
], | ||
{ | ||
title: Title.SELECT_PLOT_TYPE | ||
} | ||
) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { quickPickValue } from '../vscode/quickPick' | ||
import { Title } from '../vscode/title' | ||
|
||
export const enum PLOT_TYPE { | ||
CUSTOM = 'custom', | ||
DATA_SERIES = 'data-series' | ||
} | ||
|
||
export const pickPlotType = () => | ||
quickPickValue( | ||
[ | ||
{ | ||
description: | ||
'Create a data series plot definition by selecting data from a file', | ||
label: 'Data Series', | ||
value: PLOT_TYPE.DATA_SERIES | ||
}, | ||
{ | ||
description: | ||
'Create an extension-only plot by selecting one metric and one param from the experiments table', | ||
label: 'Custom', | ||
value: PLOT_TYPE.CUSTOM | ||
} | ||
], | ||
{ | ||
title: Title.SELECT_PLOT_TYPE | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.