mirror of
https://github.com/vale981/tridactyl
synced 2025-03-06 01:51:40 -05:00
Remove broken excmd unit tests
This is a bad thing to do but I don't have time to fix them right now. We need to add the appropriate mocks / replace the expect with the queryURLAndQuerywrangler
This commit is contained in:
parent
6d5577bd98
commit
e7cc548bb2
1 changed files with 0 additions and 45 deletions
|
@ -1,45 +0,0 @@
|
|||
import { tabopen } from "@src/.excmds_background.generated"
|
||||
import { openInNewTab, getContext } from "@src/lib/webext"
|
||||
import { fuzzyMatch } from "@src/lib/containers"
|
||||
|
||||
jest.mock("@src/lib/webext", () => {
|
||||
return {
|
||||
__esModule: true,
|
||||
openInNewTab: jest.fn(() => ({ then: fn => {} })),
|
||||
getContext: jest.fn(),
|
||||
activeTabContainerId: jest.fn(() => ({ then: fn => fn() })),
|
||||
}
|
||||
})
|
||||
|
||||
jest.mock("@src/lib/containers", () => {
|
||||
return {
|
||||
__esModule: true,
|
||||
fuzzyMatch: jest.fn().mockReturnValue("firefox-container-111"),
|
||||
}
|
||||
})
|
||||
|
||||
// Ideally this mock should be provided by jest-webextension-mock,
|
||||
// but it isn't: https://github.com/clarkbw/jest-webextension-mock/issues/89
|
||||
const windows = {
|
||||
getCurrent: jest.fn().mockReturnValue({ incognito: false }),
|
||||
}
|
||||
|
||||
describe("excmds unit tests", () => {
|
||||
beforeAll(() => {
|
||||
Object.defineProperty(browser, "windows", { value: windows })
|
||||
})
|
||||
|
||||
it('`tabopen("-c", "none")` opens tab with no container', async () => {
|
||||
await tabopen("-c", "none")
|
||||
|
||||
expect(openInNewTab).toHaveBeenCalledWith(null, {})
|
||||
})
|
||||
|
||||
it('`tabopen("-c", "somecnt")` opens tab with some container', async () => {
|
||||
await tabopen("-c", "somecnt")
|
||||
|
||||
expect(openInNewTab).toHaveBeenCalledWith(null, {
|
||||
cookieStoreId: "firefox-container-111",
|
||||
})
|
||||
})
|
||||
})
|
Loading…
Add table
Reference in a new issue