forked from oliverschwendener/ueli
-
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.
Merge branch 'dev' of github.com:oliverschwendener/ueli into dev
- Loading branch information
Showing
34 changed files
with
581 additions
and
410 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
23 changes: 20 additions & 3 deletions
23
src/tests/unit/search-plugins/mac-os-settings-plugin.test.ts
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 |
---|---|---|
@@ -1,15 +1,32 @@ | ||
import { MacOsSettingsPlugin } from "../../../ts/search-plugins/mac-os-settings-plugin"; | ||
import { testIconSet } from "../../../ts/icon-sets/test-icon-set"; | ||
import { MacOsSetting } from "../../../ts/operating-system-settings/macos/mac-os-setting"; | ||
|
||
describe(MacOsSettingsPlugin.name, () => { | ||
const searchPlugin = new MacOsSettingsPlugin(testIconSet); | ||
describe(MacOsSettingsPlugin.name, (): void => { | ||
const testSettings: MacOsSetting[] = [ | ||
{ executionArgument: "exec-1", name: "name-1", tags: [] }, | ||
{ executionArgument: "exec-2", name: "name-2", tags: [] }, | ||
{ executionArgument: "exec-3", name: "name-3", tags: [] }, | ||
{ executionArgument: "exec-4", name: "name-4", tags: [] }, | ||
]; | ||
|
||
describe(searchPlugin.getAllItems.name, () => { | ||
const searchPlugin = new MacOsSettingsPlugin(testSettings, testIconSet); | ||
|
||
describe(searchPlugin.getAllItems.name, (): void => { | ||
it("should return more than zero items", () => { | ||
const actual = searchPlugin.getAllItems(); | ||
expect(actual).not.toBe(undefined); | ||
expect(actual).not.toBe(null); | ||
expect(actual.length).toBeGreaterThan(0); | ||
}); | ||
}); | ||
|
||
describe(searchPlugin.getIndexLength.name, (): void => { | ||
it("should return the number of os settings", (): void => { | ||
const actual = searchPlugin.getIndexLength(); | ||
const expected = testSettings.length; | ||
|
||
expect(actual).toBe(expected); | ||
}); | ||
}); | ||
}); |
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
34 changes: 28 additions & 6 deletions
34
src/tests/unit/search-plugins/windows-10-settings-plugin.test.ts
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 |
---|---|---|
@@ -1,15 +1,37 @@ | ||
import { Windows10SettingsSearchPlugin } from "../../../ts/search-plugins/windows-10-settings-plugin"; | ||
import { testIconSet } from "../../../ts/icon-sets/test-icon-set"; | ||
import { WindowsSetting } from "../../../ts/operating-system-settings/windows/windows-setting"; | ||
import { Windows10App } from "../../../ts/operating-system-settings/windows/windows-10-app"; | ||
|
||
describe(Windows10SettingsSearchPlugin.name, () => { | ||
const searchPlugin = new Windows10SettingsSearchPlugin(testIconSet); | ||
describe(Windows10SettingsSearchPlugin.name, (): void => { | ||
const testSettings: WindowsSetting[] = [ | ||
{ executionArgument: "exec-1", name: "setting-1", tags: [] }, | ||
{ executionArgument: "exec-2", name: "setting-2", tags: [] }, | ||
{ executionArgument: "exec-3", name: "setting-3", tags: [] }, | ||
{ executionArgument: "exec-4", name: "setting-4", tags: [] }, | ||
]; | ||
|
||
describe(searchPlugin.getAllItems.name, () => { | ||
const testApps: Windows10App[] = [ | ||
{ executionArgument: "exec-1", name: "app-1", icon: "icon" }, | ||
{ executionArgument: "exec-2", name: "app-2", icon: "icon" }, | ||
{ executionArgument: "exec-3", name: "app-3", icon: "icon" }, | ||
{ executionArgument: "exec-4", name: "app-4", icon: "icon" }, | ||
]; | ||
|
||
const searchPlugin = new Windows10SettingsSearchPlugin(testSettings, testApps, testIconSet); | ||
|
||
describe(searchPlugin.getAllItems.name, (): void => { | ||
it("should return more than zero items", () => { | ||
const actual = searchPlugin.getAllItems(); | ||
expect(actual).not.toBe(undefined); | ||
expect(actual).not.toBe(null); | ||
expect(actual.length).toBeGreaterThan(0); | ||
expect(actual.length).toBe(testSettings.length + testApps.length); | ||
}); | ||
}); | ||
|
||
describe(searchPlugin.getIndexLength.name, (): void => { | ||
it("should return the number of settings", (): void => { | ||
const actual = searchPlugin.getIndexLength(); | ||
const expected = testSettings.length + testApps.length; | ||
expect(actual).toBe(expected); | ||
}); | ||
}); | ||
}); |
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
Oops, something went wrong.