mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-12 16:48:12 +00:00
add test for getKeyboardResponse
can return a lower case version of the key
in some circumstances #3325
This commit is contained in:
parent
5736dbb97f
commit
2889e854a0
@ -81,6 +81,18 @@ describe("#getKeyboardResponse", () => {
|
|||||||
await keyUp("a");
|
await keyUp("a");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("should return the key in standard capitalization (issue #3325)", async () => {
|
||||||
|
const api = new KeyboardListenerAPI(getRootElement);
|
||||||
|
|
||||||
|
api.getKeyboardResponse({
|
||||||
|
callback_function: callback,
|
||||||
|
valid_responses: ["enter"],
|
||||||
|
});
|
||||||
|
|
||||||
|
await pressKey("Enter");
|
||||||
|
expect(callback).toHaveBeenCalledWith("Enter");
|
||||||
|
});
|
||||||
|
|
||||||
describe("when case_sensitive_responses is false", () => {
|
describe("when case_sensitive_responses is false", () => {
|
||||||
let api: KeyboardListenerAPI;
|
let api: KeyboardListenerAPI;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user