mirror of
https://github.com/Bismuth-Forge/bismuth.git
synced 2024-11-04 13:36:48 +03:00
test(action): ✅ add window moving action tests
This commit is contained in:
parent
78c220e496
commit
da9c10fc16
@ -159,4 +159,74 @@ describe("action", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("window resize", () => {
|
||||||
|
let fakeEngine: Engine;
|
||||||
|
let fakeCurrentWindow: Window;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fakeCurrentWindow = createMock<Window>();
|
||||||
|
|
||||||
|
fakeEngine = createMock<Engine>({
|
||||||
|
resizeWindow: jest.fn(),
|
||||||
|
currentWindow: jest.fn().mockReturnValue(fakeCurrentWindow),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("width increase", () => {
|
||||||
|
it("correctly executes", () => {
|
||||||
|
const action = new Action.IncreaseActiveWindowWidth(fakeEngine);
|
||||||
|
|
||||||
|
action.execute();
|
||||||
|
|
||||||
|
expect(fakeEngine.resizeWindow).toBeCalledWith(
|
||||||
|
fakeCurrentWindow,
|
||||||
|
"east",
|
||||||
|
1
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("width decrease", () => {
|
||||||
|
it("correctly executes", () => {
|
||||||
|
const action = new Action.DecreaseActiveWindowWidth(fakeEngine);
|
||||||
|
|
||||||
|
action.execute();
|
||||||
|
|
||||||
|
expect(fakeEngine.resizeWindow).toBeCalledWith(
|
||||||
|
fakeCurrentWindow,
|
||||||
|
"east",
|
||||||
|
-1
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("height increase", () => {
|
||||||
|
it("correctly executes", () => {
|
||||||
|
const action = new Action.IncreaseActiveWindowHeight(fakeEngine);
|
||||||
|
|
||||||
|
action.execute();
|
||||||
|
|
||||||
|
expect(fakeEngine.resizeWindow).toBeCalledWith(
|
||||||
|
fakeCurrentWindow,
|
||||||
|
"south",
|
||||||
|
1
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("height decrease", () => {
|
||||||
|
it("correctly executes", () => {
|
||||||
|
const action = new Action.DecreaseActiveWindowHeight(fakeEngine);
|
||||||
|
|
||||||
|
action.execute();
|
||||||
|
|
||||||
|
expect(fakeEngine.resizeWindow).toBeCalledWith(
|
||||||
|
fakeCurrentWindow,
|
||||||
|
"south",
|
||||||
|
-1
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user