Skip to content

Commit

Permalink
package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
chrstinalin committed Jun 21, 2024
1 parent 78920a4 commit 35b0e4a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
16 changes: 13 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,25 @@
"view/title": [
{
"command": "assay.get",
"group": "navigation@2"
"group": "navigation@2",
"when": "view == assayCommands"
},
{
"command": "assay.refresh",
"group": "navigation@1"
"group": "navigation@1",
"when": "view == assayCommands"
}

],
"view/item/context": [
{
"command": "assay.sidebarDiff",
"when": "viewItem !== guidDirectory && view == assayCommands && listDoubleSelection"
},
{
"command": "assay.viewAddon",
"group": "inline",
"when": "viewItem !== guidDirectory"
"when": "viewItem !== guidDirectory && view == assayCommands"
}
],
"explorer/context": [
Expand Down Expand Up @@ -174,6 +180,10 @@
"light": "media/sidebarIcons/refresh.svg"
}
},
{
"command": "assay.sidebarDiff",
"title": "Open Versions in Diff Tool"
},
{
"command": "assay.viewAddon",
"title": "View Addon in New Window",
Expand Down
21 changes: 14 additions & 7 deletions test/suite/controller/diffController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ import * as sinon from "sinon";
import * as vscode from "vscode";

import { DiffController } from "../../../src/controller/diffController";
import { AddonTreeItem } from "../../../src/model/sidebarTreeDataProvider";

describe("diffController.ts", async () => {
afterEach(() => {
sinon.restore();
});

describe("openInDiffTool()", () => {
describe("diffFromSidebar()", () => {
it("should return false if no diff command is provided.", async () => {
const config = {
update: sinon.stub(),
Expand All @@ -24,9 +25,12 @@ describe("diffController.ts", async () => {
const getDiffCommandStub = sinon.stub(diffController, <any>"getDiffCommand");
getDiffCommandStub.resolves(undefined);

const result = await diffController.openInDiffTool([
vscode.Uri.parse("file:///path/to/file1"),
vscode.Uri.parse("file:///path/to/file2"),
const treeItemOne = {uri: vscode.Uri.parse("file:///path/to/file1")} as AddonTreeItem;
const treeItemTwo = {uri: vscode.Uri.parse("file:///path/to/file2")} as AddonTreeItem;

const result = await diffController.diffFromSidebar(treeItemOne, [
treeItemOne,
treeItemTwo,
]);
expect(result).to.be.false;
});
Expand All @@ -49,9 +53,12 @@ describe("diffController.ts", async () => {
} as unknown as child_process.ChildProcess;
spawnStub.returns(fakeChildProcess);

const result = await diffController.openInDiffTool([
vscode.Uri.parse("file:///path/to/file1"),
vscode.Uri.parse("file:///path/to/file2"),
const treeItemOne = {uri: vscode.Uri.parse("file:///path/to/file1")} as AddonTreeItem;
const treeItemTwo = {uri: vscode.Uri.parse("file:///path/to/file2")} as AddonTreeItem;

const result = await diffController.diffFromSidebar(treeItemOne, [
treeItemOne,
treeItemTwo,
]);
expect(result).to.be.true;
});
Expand Down

0 comments on commit 35b0e4a

Please sign in to comment.