mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 05:14:54 +00:00
feat(core): added code to handle keyboard inputs (#4006)
Co-authored-by: Alex Yang <himself65@outlook.com>
This commit is contained in:
@@ -20,6 +20,39 @@ test('Open settings modal', async ({ page }) => {
|
||||
await expect(modal).toBeVisible();
|
||||
});
|
||||
|
||||
test('change language using keyboard', async ({ page }) => {
|
||||
await openHomePage(page);
|
||||
await waitEditorLoad(page);
|
||||
await openSettingModal(page);
|
||||
|
||||
const locator = page.getByTestId('language-menu-button');
|
||||
const oldName = await locator.textContent();
|
||||
await locator.click();
|
||||
await page.waitForTimeout(200);
|
||||
await page.keyboard.press('ArrowDown', {
|
||||
delay: 50,
|
||||
});
|
||||
await page.keyboard.press('Enter', {
|
||||
delay: 50,
|
||||
});
|
||||
{
|
||||
const newName = await locator.textContent();
|
||||
expect(oldName).not.toBe(newName);
|
||||
}
|
||||
await locator.click();
|
||||
await page.waitForTimeout(200);
|
||||
await page.keyboard.press('ArrowUp', {
|
||||
delay: 50,
|
||||
});
|
||||
await page.keyboard.press('Enter', {
|
||||
delay: 50,
|
||||
});
|
||||
{
|
||||
const newName = await locator.textContent();
|
||||
expect(oldName).toBe(newName);
|
||||
}
|
||||
});
|
||||
|
||||
test('Change theme', async ({ page }) => {
|
||||
await openHomePage(page);
|
||||
await waitEditorLoad(page);
|
||||
|
||||
Reference in New Issue
Block a user