-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(browser): support non US key input (#6873)
- Loading branch information
Showing
3 changed files
with
56 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { expect, test } from 'vitest' | ||
import { userEvent, page, server } from '@vitest/browser/context' | ||
|
||
test('non US keys', async () => { | ||
document.body.innerHTML = ` | ||
<input placeholder="type-#7396" /> | ||
<input placeholder="fill-#7396" /> | ||
<input placeholder="type-emoji" /> | ||
<input placeholder="fill-emoji" /> | ||
`; | ||
|
||
await userEvent.type(page.getByPlaceholder("type-#7396"), 'éèù') | ||
await expect.element(page.getByPlaceholder("type-#7396")).toHaveValue('éèù') | ||
await userEvent.fill(page.getByPlaceholder("fill-#7396"), 'éèù') | ||
await expect.element(page.getByPlaceholder("fill-#7396")).toHaveValue('éèù') | ||
|
||
// playwright: garbled characters | ||
// webdriverio: error: invalid argument: missing command parameters | ||
// preview: ok | ||
try { | ||
await userEvent.type(page.getByPlaceholder("type-emoji"), '😊😍') | ||
await expect.element(page.getByPlaceholder("type-emoji")).toHaveValue('😊😍') | ||
} catch (e) { | ||
console.error(e) | ||
} | ||
|
||
// playwright: ok | ||
// webdriverio: error: ChromeDriver only supports characters in the BMP | ||
// preview: ok | ||
try { | ||
await userEvent.fill(page.getByPlaceholder("fill-emoji"), '😊😍') | ||
await expect.element(page.getByPlaceholder("fill-emoji")).toHaveValue('😊😍') | ||
} catch (e) { | ||
console.error(e) | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters