mirror of
https://github.com/Bismuth-Forge/bismuth.git
synced 2024-09-11 00:15:37 +03:00
test(action): ✅ add simple focus up action unit test
This is just a basic unit test.
This commit is contained in:
parent
5416912efd
commit
32ae23c6a2
25
src/controller/action.test.ts
Normal file
25
src/controller/action.test.ts
Normal file
@ -0,0 +1,25 @@
|
||||
// SPDX-FileCopyrightText: 2021 Mikhail Zolotukhin <mail@genda.life>
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import { createMock } from "ts-auto-mock";
|
||||
import { Engine } from "../engine";
|
||||
import { FocusUpperWindow } from "./action";
|
||||
|
||||
describe("action", () => {
|
||||
describe("focus up", () => {
|
||||
const fakeEngine = createMock<Engine>({ focusDir: jest.fn() });
|
||||
const action = new FocusUpperWindow(fakeEngine);
|
||||
it("correctly executes", () => {
|
||||
// Arrange
|
||||
jest.spyOn(fakeEngine, "focusDir");
|
||||
|
||||
// Act
|
||||
action.execute();
|
||||
|
||||
// Assert
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
expect(fakeEngine.focusDir).toBeCalledWith("up");
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user