Skip to content

Commit

Permalink
chore(eslint): fix linting errors in e2e folder (#16006)
Browse files Browse the repository at this point in the history
  • Loading branch information
tw15egan authored Mar 21, 2024
1 parent 3a9eec7 commit 8dcbe29
Show file tree
Hide file tree
Showing 26 changed files with 76 additions and 80 deletions.
2 changes: 1 addition & 1 deletion e2e/components/CodeSnippet/CodeSnippet-test.avt.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ test.describe('@avt CodeSnippet', () => {
await page.keyboard.press('Tab');
await page.keyboard.press('Enter');
await expect(page.getByText('Show less')).toBeVisible();
await expect(page.getByText('Show more')).not.toBeVisible();
await expect(page.getByText('Show more')).toBeHidden();
});

test('@avt-keyboard-nav singleline', async ({ page }) => {
Expand Down
12 changes: 6 additions & 6 deletions e2e/components/ComboBox/ComboBox-test.avt.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ test.describe('@avt ComboBox', () => {
await page.keyboard.press('Tab');
await expect(combobox).toBeFocused();
await page.keyboard.press('Enter');
await expect(page.getByRole('combobox', { expanded: true })).toBeVisible;
await expect(page.getByRole('combobox', { expanded: true })).toBeVisible();
await expect(combobox).toBeFocused();

await expect(page).toHaveNoACViolations('ComboBox-open');
Expand All @@ -65,22 +65,22 @@ test.describe('@avt ComboBox', () => {
});

await expect(combobox).toBeVisible();
await expect(clearButton).not.toBeVisible();
await expect(clearButton).toBeHidden();
// Tab and open the ComboBox with Arrow Down
await page.keyboard.press('Tab');
await expect(combobox).toBeFocused();
await page.keyboard.press('ArrowDown');
await expect(menu).toBeVisible();
// Close with Escape, retain focus, and open with Spacebar
await page.keyboard.press('Escape');
await expect(menu).not.toBeVisible();
await expect(menu).toBeHidden();
await expect(combobox).toBeFocused();
await page.keyboard.press('Space');
await expect(menu).toBeVisible();
// Close and clear with Escape, retain focus, and open with Enter
await page.keyboard.press('Escape');
await page.keyboard.press('Escape');
await expect(menu).not.toBeVisible();
await expect(menu).toBeHidden();
await expect(combobox).toBeFocused();
await page.keyboard.press('Enter');
await expect(menu).toBeVisible();
Expand All @@ -99,11 +99,11 @@ test.describe('@avt ComboBox', () => {
);
// focus comes back to the toggle button after selecting
await expect(combobox).toBeFocused();
await expect(menu).not.toBeVisible();
await expect(menu).toBeHidden();
await expect(clearButton).toBeVisible();
// should only clear selection when escape is pressed when the menu is closed
await page.keyboard.press('Escape');
await expect(clearButton).not.toBeVisible();
await expect(clearButton).toBeHidden();
await expect(combobox).toHaveValue('');
// should highlight menu items based on text input
await page.keyboard.press('2');
Expand Down
4 changes: 2 additions & 2 deletions e2e/components/ComboButton/ComboButton-test.avt.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ test.describe('@avt ComboButton', () => {
await page.keyboard.press('ArrowDown');
await expect(page.getByRole('menuitem').nth(1)).toBeFocused();
await page.keyboard.press('Escape');
await expect(page.getByRole('menuitem').first()).not.toBeVisible();
await expect(page.getByRole('menuitem').first()).toBeHidden();
});

test('@avt-keyboard-nav ComboButton with danger', async ({ page }) => {
Expand Down Expand Up @@ -93,6 +93,6 @@ test.describe('@avt ComboButton', () => {
);
// Selecting the item to close the menu
await page.keyboard.press('Enter');
await expect(page.getByRole('menuitem').first()).not.toBeVisible();
await expect(page.getByRole('menuitem').first()).toBeHidden();
});
});
8 changes: 4 additions & 4 deletions e2e/components/ComposedModal/ComposedModal-test.avt.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ test.describe('@avt ComposedModal', () => {
await expect(page.getByRole('button', { name: 'Close' })).toBeFocused();
await page.keyboard.press('Enter');
// Make sure modal was closed
await expect(page.getByText('Account resource')).not.toBeVisible();
await expect(page.getByText('Account resource')).toBeHidden();
});

test('@avt-keyboard-nav Full width', async ({ page }) => {
Expand All @@ -102,7 +102,7 @@ test.describe('@avt ComposedModal', () => {
await expect(page.getByRole('button', { name: 'Cancel' })).toBeFocused();
await page.keyboard.press('Enter');
// Make sure modal was closed
await expect(page.getByText('Full Width Modal')).not.toBeVisible();
await expect(page.getByText('Full Width Modal')).toBeHidden();
});

test('@avt-keyboard-nav Passive modal', async ({ page }) => {
Expand All @@ -122,7 +122,7 @@ test.describe('@avt ComposedModal', () => {
// Make sure modal was closed
await expect(
page.getByText('You have been successfully signed out')
).not.toBeVisible();
).toBeHidden();
});

test('@avt-keyboard-nav With state manager', async ({ page }) => {
Expand Down Expand Up @@ -157,7 +157,7 @@ test.describe('@avt ComposedModal', () => {
await expect(page.getByRole('button', { name: 'Close' })).toBeFocused();
await page.keyboard.press('Enter');
// Make sure modal was closed and button gets focused
await expect(page.getByText('Account resource')).not.toBeVisible();
await expect(page.getByText('Account resource')).toBeHidden();
await expect(page.getByRole('button')).toBeFocused();
await expect(
page.getByRole('button', { name: 'Launch composed modal' })
Expand Down
8 changes: 4 additions & 4 deletions e2e/components/ContainedList/ContainedList-test.avt.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ test.describe('@avt ContainedList', () => {
await page.keyboard.press('ArrowDown');
await page.keyboard.press('ArrowDown');
await page.keyboard.press('Enter');
await expect(page.getByText('Remove')).not.toBeVisible();
await expect(page.getByText('Remove')).toBeHidden();
});

test('@avt-keyboard-nav With actions', async ({ page }) => {
Expand All @@ -192,7 +192,7 @@ test.describe('@avt ContainedList', () => {
).toBeFocused();
await expect(page.getByText('Dismiss').first()).toBeVisible();
await page.keyboard.press('Enter');
await expect(page.getByText('Dismiss').first()).not.toBeVisible();
await expect(page.getByText('Dismiss').first()).toBeHidden();

//navigating to the last element
await page.keyboard.press('Tab');
Expand Down Expand Up @@ -220,7 +220,7 @@ test.describe('@avt ContainedList', () => {
await expect(page.getByRole('search')).toHaveClass(/cds--search--expanded/);
page.getByRole('searchbox').fill('List item 3');
await expect(page.getByText('List item 3')).toBeVisible();
await expect(page.getByText('List item 1')).not.toBeVisible();
await expect(page.getByText('List item 1')).toBeHidden();

// Close search
await page.keyboard.press('Escape');
Expand Down Expand Up @@ -299,7 +299,7 @@ test.describe('@avt ContainedList', () => {
await expect(page.getByRole('searchbox')).toBeFocused();
page.getByRole('searchbox').fill('List item 3');
await expect(page.getByText('List item 3')).toBeVisible();
await expect(page.getByText('List item 1')).not.toBeVisible();
await expect(page.getByText('List item 1')).toBeHidden();

// Close search
await page.keyboard.press('Escape');
Expand Down
2 changes: 1 addition & 1 deletion e2e/components/DataTable/DataTable-test.avt.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ test.describe('@avt DataTable', () => {
await expect(page.getByRole('button', { name: 'Cancel' })).toBeFocused();
// Invoke the cancel button
await page.keyboard.press('Space');
await expect(page.getByText('1 item selected')).not.toBeVisible();
await expect(page.getByText('1 item selected')).toBeHidden();
// Every checkbox should no longer be checked
for (const checkbox of await page.getByRole('checkbox').all()) {
await expect(checkbox).not.toBeChecked();
Expand Down
4 changes: 2 additions & 2 deletions e2e/components/Dropdown/Dropdown-test.avt.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ test.describe('@avt Dropdown', () => {
const menu = page.getByRole('listbox');
await expect(toggleButton).toBeFocused();
await page.keyboard.press('Enter');
await expect(page.getByRole('combobox', { expanded: true })).toBeVisible;
await expect(page.getByRole('combobox', { expanded: true })).toBeVisible();
await expect(menu).toBeFocused();

await expect(page).toHaveNoACViolations('Dropdown-open');
Expand Down Expand Up @@ -68,7 +68,7 @@ test.describe('@avt Dropdown', () => {
await expect(menu).toBeVisible();
// Close with Escape, retain focus, and open with Enter
await page.keyboard.press('Escape');
await expect(menu).not.toBeVisible();
await expect(menu).toBeHidden();
await expect(toggleButton).toBeFocused();
await page.keyboard.press('Enter');
// Should focus on selected item by default
Expand Down
2 changes: 1 addition & 1 deletion e2e/components/ErrorBoundary/ErrorBoundary-test.avt.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ test.describe('@avt ErrorBoundary', () => {
);
});

test('@avt-keyboard-state', async ({ page }) => {
test('@avt-keyboard-nav', async ({ page }) => {
await visitStory(page, {
component: 'ErrorBoundary',
id: 'components-errorboundary--default',
Expand Down
6 changes: 3 additions & 3 deletions e2e/components/FileUploader/FileUploader-test.avt.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ test.describe('@avt FileUploader', () => {
// Delete the file
await page.keyboard.press('Tab');
await page.keyboard.press('Enter');
await expect(page.getByText('test-file-for-uploading')).not.toBeVisible();
await expect(page.getByText('test-file-for-uploading')).toBeHidden();
});

test.slow(
Expand Down Expand Up @@ -164,7 +164,7 @@ test.describe('@avt FileUploader', () => {
await page.keyboard.press('Enter');
await expect(
page.locator('#test-upload-file-long-text-for-tooltip-to-show-up.jpg')
).not.toBeVisible();
).toBeHidden();
}
);

Expand Down Expand Up @@ -207,6 +207,6 @@ test.describe('@avt FileUploader', () => {
await page.keyboard.press('Enter');
await expect(
page.locator('#test-upload-file-long-text-for-tooltip-to-show-up.jpg')
).not.toBeVisible();
).toBeHidden();
});
});
12 changes: 6 additions & 6 deletions e2e/components/FluidComboBox/FluidComboBox-test.avt.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ test.describe('@avt FluidComboBox', () => {
await page.keyboard.press('Tab');
await expect(combobox).toBeFocused();
await page.keyboard.press('Enter');
await expect(page.getByRole('combobox', { expanded: true })).toBeVisible;
await expect(page.getByRole('combobox', { expanded: true })).toBeVisible();
await expect(combobox).toBeFocused();

await expect(page).toHaveNoACViolations('FluidComboBox-open');
Expand All @@ -65,22 +65,22 @@ test.describe('@avt FluidComboBox', () => {
});

await expect(combobox).toBeVisible();
await expect(clearButton).not.toBeVisible();
await expect(clearButton).toBeHidden();
// Tab and open the ComboBox with Arrow Down
await page.keyboard.press('Tab');
await expect(combobox).toBeFocused();
await page.keyboard.press('ArrowDown');
await expect(menu).toBeVisible();
// Close with Escape, retain focus, and open with Spacebar
await page.keyboard.press('Escape');
await expect(menu).not.toBeVisible();
await expect(menu).toBeHidden();
await expect(combobox).toBeFocused();
await page.keyboard.press('Space');
await expect(menu).toBeVisible();
// Close and clear with Escape, retain focus, and open with Enter
await page.keyboard.press('Escape');
await page.keyboard.press('Escape');
await expect(menu).not.toBeVisible();
await expect(menu).toBeHidden();
await expect(combobox).toBeFocused();
await page.keyboard.press('Enter');
await expect(menu).toBeVisible();
Expand All @@ -99,11 +99,11 @@ test.describe('@avt FluidComboBox', () => {
);
// focus comes back to the toggle button after selecting
await expect(combobox).toBeFocused();
await expect(menu).not.toBeVisible();
await expect(menu).toBeHidden();
await expect(clearButton).toBeVisible();
// should only clear selection when escape is pressed when the menu is closed
await page.keyboard.press('Escape');
await expect(clearButton).not.toBeVisible();
await expect(clearButton).toBeHidden();
await expect(combobox).toHaveValue('');
// should highlight menu items based on text input
await page.keyboard.press('2');
Expand Down
2 changes: 1 addition & 1 deletion e2e/components/FluidDropdown/FluidDropdown-test.avt.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ test.describe('@avt FluidDropdown', () => {
await expect(menu).toBeVisible();
// Close with Escape, retain focus, and open with Enter
await page.keyboard.press('Escape');
await expect(menu).not.toBeVisible();
await expect(menu).toBeHidden();
await expect(toggleButton).toBeFocused();
await page.keyboard.press('Enter');
// Should focus on selected item by default
Expand Down
20 changes: 10 additions & 10 deletions e2e/components/FluidMultiSelect/FluidMultiSelect-test.avt.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,21 @@ test.describe('@avt FluidMultiSelect', () => {
const menu = page.getByRole('listbox');

await expect(toggleButton).toBeVisible();
await expect(selection).not.toBeVisible();
await expect(selection).toBeHidden();
// Tab and open the MultiSelect with Arrow Down
await page.keyboard.press('Tab');
await expect(toggleButton).toBeFocused();
await page.keyboard.press('ArrowDown');
await expect(menu).toBeVisible();
// Close with Escape, retain focus, and open with Enter
await page.keyboard.press('Escape');
await expect(menu).not.toBeVisible();
await expect(menu).toBeHidden();
await expect(toggleButton).toBeFocused();
await page.keyboard.press('Enter');
await expect(menu).toBeVisible();
// Close with Escape, retain focus, and open with Spacebar
await page.keyboard.press('Escape');
await expect(menu).not.toBeVisible();
await expect(menu).toBeHidden();
await expect(toggleButton).toBeFocused();
await page.keyboard.press('Space');
await expect(menu).toBeVisible();
Expand Down Expand Up @@ -134,11 +134,11 @@ test.describe('@avt FluidMultiSelect', () => {
await page.keyboard.press('Escape');
await expect(toggleButton).toBeFocused();
// should show count of selected items when closed
await expect(menu).not.toBeVisible();
await expect(menu).toBeHidden();
await expect(selection).toBeVisible();
// should only clear selection when escape is pressed when the menu is closed
await page.keyboard.press('Escape');
await expect(selection).not.toBeVisible();
await expect(selection).toBeHidden();
});

test('@avt-keyboard-nav FluidMultiSelect condensed', async ({ page }) => {
Expand All @@ -158,21 +158,21 @@ test.describe('@avt FluidMultiSelect', () => {
const menu = page.getByRole('listbox');

await expect(toggleButton).toBeVisible();
await expect(selection).not.toBeVisible();
await expect(selection).toBeHidden();
// Tab and open the MultiSelect with Arrow Down
await page.keyboard.press('Tab');
await expect(toggleButton).toBeFocused();
await page.keyboard.press('ArrowDown');
await expect(menu).toBeVisible();
// Close with Escape, retain focus, and open with Enter
await page.keyboard.press('Escape');
await expect(menu).not.toBeVisible();
await expect(menu).toBeHidden();
await expect(toggleButton).toBeFocused();
await page.keyboard.press('Enter');
await expect(menu).toBeVisible();
// Close with Escape, retain focus, and open with Spacebar
await page.keyboard.press('Escape');
await expect(menu).not.toBeVisible();
await expect(menu).toBeHidden();
await expect(toggleButton).toBeFocused();
await page.keyboard.press('Space');
await expect(menu).toBeVisible();
Expand Down Expand Up @@ -229,10 +229,10 @@ test.describe('@avt FluidMultiSelect', () => {
await page.keyboard.press('Escape');
await expect(toggleButton).toBeFocused();
// should show count of selected items when closed
await expect(menu).not.toBeVisible();
await expect(menu).toBeHidden();
await expect(selection).toBeVisible();
// should only clear selection when escape is pressed when the menu is closed
await page.keyboard.press('Escape');
await expect(selection).not.toBeVisible();
await expect(selection).toBeHidden();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
const { expect, test } = require('@playwright/test');
const { visitStory } = require('../../test-utils/storybook');

test.describe('F@avt luidNumberInput', () => {
test.describe('@avt FluidNumberInput', () => {
test('@avt-default-state', async ({ page }) => {
await visitStory(page, {
component: 'FluidNumberInput',
Expand Down
2 changes: 1 addition & 1 deletion e2e/components/FluidSearch/FluidSearch-test.avt.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ test.describe('@avt FluidSearch', () => {
name: 'Clear search input',
});
await expect(search).toBeVisible();
await expect(clearButton).not.toBeVisible();
await expect(clearButton).toBeHidden();

// Tab to the Search
await page.keyboard.press('Tab');
Expand Down
2 changes: 1 addition & 1 deletion e2e/components/FormLabel/FormLabel-test.avt.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ test.describe('@avt FormLabel', () => {
'This can be used to provide more information about a field.'
)
.last()
).not.toBeVisible();
).toBeHidden();
});
});
4 changes: 2 additions & 2 deletions e2e/components/Menu/Menu-test.avt.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ test.describe('@avt Menu', () => {

await expect(firstItem).toBeVisible();
await expect(LastItem).toBeVisible();
await expect(nestedMenu).not.toBeVisible();
await expect(nestedMenu).toBeHidden();
await expect(firstItem).toBeFocused();

// Should go to last item when focused on the first item and arrow up is pressed
Expand All @@ -64,6 +64,6 @@ test.describe('@avt Menu', () => {

// Should close menu with ArrowLeft
await page.keyboard.press('ArrowLeft');
await expect(nestedMenu).not.toBeVisible();
await expect(nestedMenu).toBeHidden();
});
});
2 changes: 1 addition & 1 deletion e2e/components/Modal/Modal-test.avt.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ test.describe('@avt Modal', () => {
await page.keyboard.press('Enter');

// The modal should no longer be open/visisble
await expect(page.getByRole('dialog')).not.toBeVisible();
await expect(page.getByRole('dialog')).toBeHidden();
// Focus moves to the button that opened the Modal
await expect(button).toBeFocused();
});
Expand Down
Loading

0 comments on commit 8dcbe29

Please sign in to comment.