Challenge: Keyboard shortcut combinations

When you are testing your app, sometimes you need to simulate user interaction that is more complex than just clicking a button or typing into a text input box.

In this challenge there is a component which will run a callback function (passed in as a prop) when the user types Ctrl+Shift+K.

In this challenge, you need to work out how to update the test so it passes (and tests the keyboard shortcut correctly).

i
Challenge Mode: This lesson is actually a challenge - you are given a half working test and have to figure out how to get it working correctly.

You can use our courses to learn how to solve this challenge - there are courses on everything from basic Jest/Vitest fundamentals, down to how to test frontend code (using React Testing Library).

Loading full lesson content & code...

Ready to try running tests for this lesson?