-
Notifications
You must be signed in to change notification settings - Fork 0
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
4 changed files
with
62 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`createConnectTextAndTooltip > should return text and tooltip: 'connected' 1`] = ` | ||
{ | ||
"text": "$(vm-connect) DHC: localhost:10000", | ||
"tooltip": "Connected to http://localhost:10000", | ||
} | ||
`; | ||
|
||
exports[`createConnectTextAndTooltip > should return text and tooltip: 'connecting' 1`] = ` | ||
{ | ||
"text": "$(sync~spin) Deephaven: Connecting...", | ||
"tooltip": "Connecting to http://localhost:10000...", | ||
} | ||
`; | ||
|
||
exports[`createConnectTextAndTooltip > should return text and tooltip: 'disconnected' 1`] = ` | ||
{ | ||
"text": "$(debug-disconnect) Deephaven: Disconnected", | ||
"tooltip": "Connect to Deephaven", | ||
} | ||
`; |
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,22 @@ | ||
import { describe, it, expect, vi } from 'vitest'; | ||
import { createConnectTextAndTooltip, ConnectionOption } from './uiUtils'; | ||
|
||
// See __mocks__/vscode.ts for the mock implementation | ||
vi.mock('vscode'); | ||
|
||
describe('createConnectTextAndTooltip', () => { | ||
const option: ConnectionOption = { | ||
type: 'DHC', | ||
consoleType: 'python', | ||
label: 'DHC: localhost:10000', | ||
url: 'http://localhost:10000', | ||
}; | ||
|
||
it.each([['connecting'], ['connected'], ['disconnected']] as const)( | ||
`should return text and tooltip: '%s'`, | ||
status => { | ||
const actual = createConnectTextAndTooltip(status, option); | ||
expect(actual).toMatchSnapshot(); | ||
} | ||
); | ||
}); |
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