Skip to content

Commit

Permalink
Replaced another class with interface
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverschwendener committed Sep 27, 2018
1 parent 118a04b commit 39b0e80
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions src/tests/unit/search-plugins/shortcut-plugin.test.ts
Expand Up @@ -4,16 +4,18 @@ import { Shortcut } from "../../../ts/shortcut";
describe(ShortcutsPlugin.name, (): void => {
describe("getAllItems", (): void => {
it("should set the execution argument correctly", (): void => {
const shortcuts = [
const shortcuts: Shortcut[] = [
{
executionArgument: "execution-argument",
icon: "icon",
name: "Custom Shortcut 1",
},
{
executionArgument: "execution-argument-2",
icon: "icon",
name: "Custom Shortcut 2",
},
] as Shortcut[];
];

const plugin = new ShortcutsPlugin(shortcuts, "");

Expand Down Expand Up @@ -60,7 +62,7 @@ describe(ShortcutsPlugin.name, (): void => {
it("should set the given icon if it is specified", (): void => {
const defaultIcon = "this is the default icon";

const shortcuts = [
const shortcuts: Shortcut[] = [
{
executionArgument: "execution-argument",
icon: "another icon",
Expand All @@ -71,7 +73,7 @@ describe(ShortcutsPlugin.name, (): void => {
icon: "another icon 2",
name: "Custom Shortcut 2",
},
] as Shortcut[];
];

const plugin = new ShortcutsPlugin(shortcuts, defaultIcon);

Expand Down
8 changes: 4 additions & 4 deletions src/ts/shortcut.ts
@@ -1,5 +1,5 @@
export class Shortcut {
public name: string;
public executionArgument: string;
public icon: string;
export interface Shortcut {
name: string;
executionArgument: string;
icon: string;
}

0 comments on commit 39b0e80

Please sign in to comment.