-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into ts-fileuploaderdropcontainer-labeltext-undef…
…ined
- Loading branch information
Showing
63 changed files
with
1,647 additions
and
948 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
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
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
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
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
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+4.31 KB
.yarn/cache/@babel-helper-environment-visitor-npm-7.22.20-260909e014-d80ee98ff6.zip
Binary file not shown.
Binary file removed
BIN
-4.34 KB
.yarn/cache/@babel-helper-environment-visitor-npm-7.22.5-7bc52eec61-248532077d.zip
Binary file not shown.
Binary file removed
BIN
-8.75 KB
.yarn/cache/@babel-helper-function-name-npm-7.22.5-8a1a69b63d-6b1f6ce1b1.zip
Binary file not shown.
Binary file added
BIN
+8.77 KB
.yarn/cache/@babel-helper-function-name-npm-7.23.0-ce38271242-e44542257b.zip
Binary file not shown.
Binary file added
BIN
+17.5 KB
.yarn/cache/@babel-helper-validator-identifier-npm-7.22.20-18305bb306-136412784d.zip
Binary file not shown.
Binary file removed
BIN
-17.5 KB
.yarn/cache/@babel-helper-validator-identifier-npm-7.22.5-4536624779-7f0f301134.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,69 @@ | ||
/** | ||
* Copyright IBM Corp. 2023 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const { expect, test } = require('@playwright/test'); | ||
const { visitStory } = require('../../test-utils/storybook'); | ||
|
||
test.describe('Menu @avt', () => { | ||
test('@avt-default-state', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'Menu', | ||
id: 'components-menu--playground', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
}); | ||
await expect(page).toHaveNoACViolations('Menu @avt-default-state'); | ||
}); | ||
|
||
test('@avt-keyboard-nav Menu', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'Menu', | ||
id: 'components-menu--playground', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
}); | ||
|
||
const firstItem = page.getByRole('menuitem', { name: 'Share with' }); | ||
const LastItem = page.getByRole('menuitem', { name: 'Delete' }); | ||
const nestedMenu = page.getByRole('menu', { name: 'Share with' }); | ||
const nestedMenuItem = page | ||
.getByRole('menuitemradio', { | ||
name: 'None', | ||
}) | ||
.first(); | ||
|
||
await expect(firstItem).toBeVisible(); | ||
await expect(LastItem).toBeVisible(); | ||
await expect(nestedMenu).not.toBeVisible(); | ||
await expect(firstItem).toBeFocused(); | ||
|
||
// Should go to last item when focused on the first item and arrow up is pressed | ||
await page.keyboard.press('ArrowUp'); | ||
await expect(LastItem).toBeFocused(); | ||
|
||
// Should open menu with ArrowRight and focus on first item | ||
await page.keyboard.press('ArrowDown'); | ||
await expect(firstItem).toBeFocused(); | ||
await page.keyboard.press('ArrowRight'); | ||
await expect(nestedMenu).toBeVisible(); | ||
await expect(nestedMenuItem).toBeVisible(); | ||
await expect(nestedMenuItem).toBeFocused(); | ||
await expect(nestedMenuItem).not.toBeChecked(); | ||
|
||
// Should select item with enter key | ||
await page.keyboard.press('Enter'); | ||
await expect(nestedMenuItem).toBeChecked(); | ||
|
||
// Should close menu with ArrowLeft | ||
await page.keyboard.press('ArrowLeft'); | ||
await expect(nestedMenu).not.toBeVisible(); | ||
}); | ||
}); |
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
Oops, something went wrong.