mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-09-23 15:03:24 +02:00
Changing test mocker to send pointer events
This commit is contained in:
parent
0ec3f8eb78
commit
4f698e1d58
@ -31,22 +31,22 @@ describe("Inputs", () => {
|
||||
game.inputsHandler = new InputsHandler(game.scene);
|
||||
});
|
||||
|
||||
it.todo("Mobile - test touch holding for 1ms - 1 input", async () => {
|
||||
it("Mobile - test touch holding for 1ms - 1 input", async () => {
|
||||
await game.inputsHandler.pressTouch("dpadUp", 1);
|
||||
expect(game.inputsHandler.log.length).toBe(1);
|
||||
});
|
||||
|
||||
it.todo("Mobile - test touch holding for 200ms - 1 input", async () => {
|
||||
it("Mobile - test touch holding for 200ms - 1 input", async () => {
|
||||
await game.inputsHandler.pressTouch("dpadUp", 200);
|
||||
expect(game.inputsHandler.log.length).toBe(1);
|
||||
});
|
||||
|
||||
it.todo("Mobile - test touch holding for 300ms - 2 input", async () => {
|
||||
it("Mobile - test touch holding for 300ms - 2 input", async () => {
|
||||
await game.inputsHandler.pressTouch("dpadUp", 300);
|
||||
expect(game.inputsHandler.log.length).toBe(2);
|
||||
});
|
||||
|
||||
it.todo("Mobile - test touch holding for 1000ms - 4 input", async () => {
|
||||
it("Mobile - test touch holding for 1000ms - 4 input", async () => {
|
||||
await game.inputsHandler.pressTouch("dpadUp", 1050);
|
||||
expect(game.inputsHandler.log.length).toBe(5);
|
||||
});
|
||||
|
@ -111,7 +111,7 @@ class FakeMobile {
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
const event = new Event("touchstart");
|
||||
const event = new Event("pointerdown");
|
||||
node.dispatchEvent(event);
|
||||
}
|
||||
|
||||
@ -120,7 +120,7 @@ class FakeMobile {
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
const event = new Event("touchend");
|
||||
const event = new Event("pointerup");
|
||||
node.dispatchEvent(event);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user