Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/__integ__/page-objects/button-dropdown-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default class ButtonDropdownPage extends BasePageObject {
return this.findButtonDropdown().findNativeButton().toSelector();
}
public getItem(itemId: string) {
return this.findButtonDropdown().findItemById(itemId).toSelector();
return this.findButtonDropdown().findItemById(itemId)!.toSelector();
}

public getCategoryItem(itemId: string) {
Expand All @@ -45,14 +45,14 @@ export default class ButtonDropdownPage extends BasePageObject {
}

public getItemCount(itemId: string) {
return this.getElementsCount(this.findButtonDropdown().findItemById(itemId).toSelector());
return this.getElementsCount(this.findButtonDropdown().findItemById(itemId)!.toSelector());
}
public getAllItemsCount() {
return this.getElementsCount(this.findButtonDropdown().findItems().toSelector());
}

public getHighlightedElementText() {
const element = this.findButtonDropdown().findHighlightedItem();
const element = this.findButtonDropdown().findHighlightedItem()!;
return this.getText(element.toSelector());
}

Expand Down
131 changes: 95 additions & 36 deletions src/__tests__/snapshot-tests/__snapshots__/documenter.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -31142,12 +31142,7 @@ This utility does not open the dropdown. To find dropdown items, call \`openDrop
"parameters": [],
"returnType": {
"isNullable": true,
"name": "ElementWrapper",
"typeArguments": [
{
"name": "HTMLElement",
},
],
"name": "ButtonDropdownItemWrapper",
},
},
{
Expand All @@ -31166,12 +31161,7 @@ This utility does not open the dropdown. To find dropdown items, call \`openDrop
],
"returnType": {
"isNullable": true,
"name": "ElementWrapper",
"typeArguments": [
{
"name": "HTMLElement",
},
],
"name": "ButtonDropdownItemWrapper",
},
},
{
Expand Down Expand Up @@ -31204,7 +31194,7 @@ This utility does not open the dropdown. To find dropdown items, call \`openDrop
"name": "Array",
"typeArguments": [
{
"name": "ElementWrapper<HTMLElement>",
"name": "ButtonDropdownItemWrapper",
},
],
},
Expand Down Expand Up @@ -31262,6 +31252,53 @@ This utility does not open the dropdown. To find dropdown items, call \`openDrop
],
"name": "ButtonDropdownWrapper",
},
{
"methods": [
{
"description": "Finds the label tag of a dropdown item.",
"name": "findLabelTag",
"parameters": [],
"returnType": {
"isNullable": true,
"name": "ElementWrapper",
"typeArguments": [
{
"name": "HTMLElement",
},
],
},
},
{
"description": "Finds the secondary text of a dropdown item.",
"name": "findSecondaryText",
"parameters": [],
"returnType": {
"isNullable": true,
"name": "ElementWrapper",
"typeArguments": [
{
"name": "HTMLElement",
},
],
},
},
{
"description": "Finds the text of a dropdown item.",
"name": "findText",
"parameters": [],
"returnType": {
"isNullable": true,
"name": "ElementWrapper",
"typeArguments": [
{
"name": "HTMLElement",
},
],
},
},
],
"name": "ButtonDropdownItemWrapper",
},
{
"methods": [
{
Expand Down Expand Up @@ -41144,12 +41181,7 @@ This utility does not open the dropdown. To find dropdown items, call \`openDrop
"parameters": [],
"returnType": {
"isNullable": true,
"name": "ElementWrapper",
"typeArguments": [
{
"name": "HTMLElement",
},
],
"name": "ButtonDropdownItemWrapper",
},
},
{
Expand All @@ -41171,12 +41203,7 @@ This utility does not open the dropdown. To find dropdown items, call \`openDrop
],
"returnType": {
"isNullable": true,
"name": "ElementWrapper",
"typeArguments": [
{
"name": "HTMLElement",
},
],
"name": "ButtonDropdownItemWrapper",
},
},
{
Expand Down Expand Up @@ -41215,7 +41242,7 @@ This utility does not open the dropdown. To find dropdown items, call \`openDrop
"name": "Array",
"typeArguments": [
{
"name": "ElementWrapper<HTMLElement>",
"name": "ButtonDropdownItemWrapper",
},
],
},
Expand Down Expand Up @@ -42451,8 +42478,8 @@ This utility does not open the dropdown. To find dropdown items, call \`openDrop
"name": "findHighlightedItem",
"parameters": [],
"returnType": {
"isNullable": false,
"name": "ElementWrapper",
"isNullable": true,
"name": "ButtonDropdownItemWrapper",
},
},
{
Expand All @@ -42470,8 +42497,8 @@ This utility does not open the dropdown. To find dropdown items, call \`openDrop
},
],
"returnType": {
"isNullable": false,
"name": "ElementWrapper",
"isNullable": true,
"name": "ButtonDropdownItemWrapper",
},
},
{
Expand All @@ -42485,7 +42512,7 @@ This utility does not open the dropdown. To find dropdown items, call \`openDrop
"name": "MultiElementWrapper",
"typeArguments": [
{
"name": "ElementWrapper",
"name": "ButtonDropdownItemWrapper",
},
],
},
Expand Down Expand Up @@ -42525,6 +42552,38 @@ This utility does not open the dropdown. To find dropdown items, call \`openDrop
],
"name": "ButtonDropdownWrapper",
},
{
"methods": [
{
"description": "Finds the label tag of a dropdown item.",
"name": "findLabelTag",
"parameters": [],
"returnType": {
"isNullable": false,
"name": "ElementWrapper",
},
},
{
"description": "Finds the secondary text of a dropdown item.",
"name": "findSecondaryText",
"parameters": [],
"returnType": {
"isNullable": false,
"name": "ElementWrapper",
},
},
{
"description": "Finds the text of a dropdown item.",
"name": "findText",
"parameters": [],
"returnType": {
"isNullable": false,
"name": "ElementWrapper",
},
},
],
"name": "ButtonDropdownItemWrapper",
},
{
"methods": [
{
Expand Down Expand Up @@ -49497,8 +49556,8 @@ This utility does not open the dropdown. To find dropdown items, call \`openDrop
"name": "findHighlightedItem",
"parameters": [],
"returnType": {
"isNullable": false,
"name": "ElementWrapper",
"isNullable": true,
"name": "ButtonDropdownItemWrapper",
},
},
{
Expand All @@ -49519,8 +49578,8 @@ This utility does not open the dropdown. To find dropdown items, call \`openDrop
},
],
"returnType": {
"isNullable": false,
"name": "ElementWrapper",
"isNullable": true,
"name": "ButtonDropdownItemWrapper",
},
},
{
Expand All @@ -49537,7 +49596,7 @@ This utility does not open the dropdown. To find dropdown items, call \`openDrop
"name": "MultiElementWrapper",
"typeArguments": [
{
"name": "ElementWrapper",
"name": "ButtonDropdownItemWrapper",
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,11 @@ exports[`test-utils selectors 1`] = `
"awsui_expandable_16mm3",
"awsui_highlighted_93a1u",
"awsui_item-element_93a1u",
"awsui_label-tag_93a1u",
"awsui_secondary-text_93a1u",
"awsui_split-trigger_sne0l",
"awsui_test-utils-button-trigger_sne0l",
"awsui_text_wxf7i",
"awsui_title_sne0l",
],
"button-group": [
Expand Down
2 changes: 1 addition & 1 deletion src/app-layout/__integ__/app-layout-drawers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
if (width < inOverflowMenuWidth) {
//links on mobile is thrown inside the overflow menu
await this.click(wrapper.findDrawersOverflowTrigger().toSelector());
await this.click(wrapper.findDrawersOverflowTrigger().findItemById(thirdDrawerId).toSelector());
await this.click(wrapper.findDrawersOverflowTrigger().findItemById(thirdDrawerId)!.toSelector());
}
} else {
await this.click(wrapper.findDrawerTriggerById(thirdDrawerId).toSelector());
Expand Down Expand Up @@ -224,7 +224,7 @@
);

await page.openThirdDrawer(theme === 'refresh-toolbar');
//todo: resolve split panel positioning change on large drawer openeing

Check warning on line 227 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Build components (React 18)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 227 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Build components

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 227 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components accessibility tests shards (4/6)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 227 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components accessibility tests shards (1/6)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 227 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components motion tests (React 18)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 227 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components motion tests (React 16)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 227 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / build (React 18) / build

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 227 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / build / build

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 227 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components unit tests

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 227 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components integration tests shards (React 16, shard 4/4)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 227 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components integration tests shards (React 18, shard 4/4)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 227 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components integration tests shards (React 18, shard 1/4)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 227 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components integration tests shards (React 16, shard 3/4)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 227 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components integration tests shards (React 16, shard 1/4)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 227 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components integration tests shards (React 18, shard 3/4)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 227 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components integration tests shards (React 18, shard 2/4)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 227 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components integration tests shards (React 16, shard 2/4)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 227 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components accessibility tests shards (2/6)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 227 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components accessibility tests shards (3/6)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 227 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components accessibility tests shards (6/6)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'

Check warning on line 227 in src/app-layout/__integ__/app-layout-drawers.test.ts

View workflow job for this annotation

GitHub Actions / dry-run / Components accessibility tests shards (5/6)

Unexpected 'todo' comment: 'todo: resolve split panel positioning...'
const expectedSplitPanelSelector =
theme === 'refresh-toolbar'
? wrapper.findSplitPanel().findOpenPanelSide().toSelector()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('Button Dropdown - Disabled Reason', () => {
it(
'closes on escape',
setupTest(async page => {
await page.hoverElement(page.findButtonDropdown().findItemById('connect').toSelector());
await page.hoverElement(page.findButtonDropdown().findItemById('connect')!.toSelector());
await page.waitForVisible(page.findDisabledReason().toSelector());
expect(await page.getDisabledReason()).toEqual('Instance must be running.');
await page.keys('Escape');
Expand All @@ -64,10 +64,10 @@ describe('Button Dropdown - Disabled Reason', () => {
it(
'opens and closes on mouse hover',
setupTest(async page => {
await page.hoverElement(page.findButtonDropdown().findItemById('connect').toSelector());
await page.hoverElement(page.findButtonDropdown().findItemById('connect')!.toSelector());
await page.waitForVisible(page.findDisabledReason().toSelector());
expect(await page.getDisabledReason()).toEqual('Instance must be running.');
await page.hoverElement(page.findButtonDropdown().findItemById('manage-state').toSelector());
await page.hoverElement(page.findButtonDropdown().findItemById('manage-state')!.toSelector());
await page.waitForVisible(page.findDisabledReason().toSelector());
expect(await page.getDisabledReason()).toContain('Instance state must not be pending or stopping.');
await page.hoverElement(page.findButtonDropdown().findExpandableCategoryById('settings').toSelector());
Expand All @@ -81,10 +81,10 @@ describe('Button Dropdown - Disabled Reason', () => {
it(
`opens and closes on click when mobile=${mobile}`,
setupTest(async page => {
await page.click(page.findButtonDropdown().findItemById('manage-state').toSelector());
await page.click(page.findButtonDropdown().findItemById('manage-state')!.toSelector());
await page.waitForVisible(page.findDisabledReason().toSelector());
expect(await page.getDisabledReason()).toContain('Instance state must not be pending or stopping.');
await page.click(page.findButtonDropdown().findItemById('connect').toSelector());
await page.click(page.findButtonDropdown().findItemById('connect')!.toSelector());
await page.waitForVisible(page.findDisabledReason().toSelector());
expect(await page.getDisabledReason()).toEqual('Instance must be running.');
await page.hoverElement(page.findButtonDropdown().findExpandableCategoryById('settings').toSelector());
Expand Down Expand Up @@ -128,7 +128,7 @@ describe('Button Dropdown - Disabled Reason', () => {
expect(await page.getDisabledReason()).toEqual(
'Instance must be running and not already be attached to an Auto Scaling Group.'
);
await page.hoverElement(page.findButtonDropdown().findItemById('termination-protection').toSelector());
await page.hoverElement(page.findButtonDropdown().findItemById('termination-protection')!.toSelector());
await page.waitForAssertion(async () =>
expect(await page.isDisplayed(page.findDisabledReason().toSelector())).toBeFalsy()
);
Expand All @@ -144,7 +144,7 @@ describe('Button Dropdown - Disabled Reason', () => {
await page.toggleAlignment();
await page.openDropdown();
}
await page.hoverElement(page.findButtonDropdown().findItemById('connect').toSelector());
await page.hoverElement(page.findButtonDropdown().findItemById('connect')!.toSelector());
await page.waitForVisible(page.findDisabledReason().toSelector());
expect(await page.overlapsDropdown()).toBeFalsy();
await page.click(page.findButtonDropdown().findExpandableCategoryById('settings').toSelector());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const setupTest = (itemId: string, testFn: (page: ButtonDropdownPage, itemId: st
await expect(page.getDropdownCheckMessage()).resolves.toEqual('');
await page.openDropdown();
if (itemId) {
await page.click(page.findButtonDropdown().findItemById(itemId).toSelector());
await page.click(page.findButtonDropdown().findItemById(itemId)!.toSelector());
}
await testFn(page, itemId);
});
Expand Down Expand Up @@ -48,15 +48,15 @@ describe('clicking on a ButtonDropdown item', () => {
'allows navigation on item with href - mouse',
setupTest('', async page => {
const oldLocation = await page.getLocation();
await page.click(page.findButtonDropdown().findItemById('plain_href').toSelector());
await page.click(page.findButtonDropdown().findItemById('plain_href')!.toSelector());
await expect(page.getLocation()).resolves.not.toEqual(oldLocation);
})
);
test(
'allows navigation to be prevented on item with href - mouse',
setupTest('', async page => {
const oldLocation = await page.getLocation();
await page.click(page.findButtonDropdown().findItemById('plain_href_prevented').toSelector());
await page.click(page.findButtonDropdown().findItemById('plain_href_prevented')!.toSelector());
await expect(page.getLocation()).resolves.toEqual(oldLocation);
})
);
Expand Down
Loading
Loading