-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdependencyReportPanel.test.ts
34 lines (27 loc) · 1 KB
/
dependencyReportPanel.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import * as vscode from 'vscode';
import * as chai from 'chai';
import * as sinon from 'sinon';
import * as sinonChai from 'sinon-chai';
import { context } from './vscontext.mock';
import { DependencyReportPanel } from '../src/dependencyReportPanel';
const expect = chai.expect;
chai.use(sinonChai);
suite('DependencyReportPanel Modules', () => {
let sandbox: sinon.SinonSandbox;
setup(() => {
sandbox = sinon.createSandbox();
});
teardown(() => {
sandbox.restore();
});
test('doUpdatePanel should render and update data', async () => {
DependencyReportPanel.createOrShow(context.extensionPath, null);
DependencyReportPanel.currentPanel.doUpdatePanel({ external_request_id: '12345' });
expect(DependencyReportPanel.data.external_request_id).equals('12345');
});
test('dispose current panel', async () => {
DependencyReportPanel.currentPanel.dispose();
expect(DependencyReportPanel.currentPanel).equals(undefined);
expect(DependencyReportPanel.data).equals(null);
});
});