@@ -108,7 +118,7 @@ const Overflow = ({
{startIndex}}
- overflowPlacement={config.overflowPlacement}
+ overflowPlacement={overflowPlacement}
>
{buttons}
diff --git a/testing/e2e/app/routes/Table/route.tsx b/testing/e2e/app/routes/Table/route.tsx
index 65617b96964..b90f1e07feb 100644
--- a/testing/e2e/app/routes/Table/route.tsx
+++ b/testing/e2e/app/routes/Table/route.tsx
@@ -11,8 +11,9 @@ export default function TableTest() {
const [searchParams] = useSearchParams();
const config = getConfigFromSearchParams(searchParams);
+ const { exampleType } = config;
- return config.exampleType === 'withTablePaginator' ? (
+ return exampleType === 'withTablePaginator' ? (
) : (
@@ -66,7 +67,25 @@ const Default = ({
}: {
config: ReturnType;
}) => {
- const data = config.subRows
+ const {
+ subRows,
+ oneRow,
+ empty,
+ columnResizeMode,
+ density,
+ disableResizing,
+ enableVirtualization,
+ filter,
+ isSelectable,
+ maxWidths,
+ minWidths,
+ scroll,
+ scrollRow,
+ selectSubRows,
+ stateReducer,
+ } = config;
+
+ const data = subRows
? [
{
index: 1,
@@ -144,9 +163,9 @@ const Default = ({
);
const virtualizedData = React.useMemo(() => {
- const size = config.oneRow ? 1 : 100000;
+ const size = oneRow ? 1 : 100000;
const arr = new Array(size);
- if (!config.empty) {
+ if (!empty) {
for (let i = 0; i < size; ++i) {
arr[i] = {
index: i,
@@ -157,7 +176,7 @@ const Default = ({
}
}
return arr;
- }, [config.oneRow, config.empty]);
+ }, [oneRow, empty]);
return (
<>
@@ -167,16 +186,16 @@ const Default = ({
Header: '#',
accessor: 'index',
width: 100,
- maxWidth: parseInt(config.maxWidths[0]) || undefined,
- minWidth: parseInt(config.minWidths[0]) || undefined,
+ maxWidth: parseInt(maxWidths[0]) || undefined,
+ minWidth: parseInt(minWidths[0]) || undefined,
},
{
Header: 'Name',
accessor: 'name',
- maxWidth: parseInt(config.maxWidths[1]) || undefined,
- minWidth: parseInt(config.minWidths[1]) || undefined,
- disableResizing: config.disableResizing,
- Filter: config.filter ? tableFilters.TextFilter() : undefined,
+ maxWidth: parseInt(maxWidths[1]) || undefined,
+ minWidth: parseInt(minWidths[1]) || undefined,
+ disableResizing: disableResizing,
+ Filter: filter ? tableFilters.TextFilter() : undefined,
},
{
Header: 'Description',
@@ -189,27 +208,25 @@ const Default = ({
width: '8rem',
},
]}
- data={config.enableVirtualization ? virtualizedData : data}
+ data={enableVirtualization ? virtualizedData : data}
emptyTableContent='No data.'
isResizable
isRowDisabled={isRowDisabled}
- isSelectable={config.isSelectable}
+ isSelectable={isSelectable}
isSortable
- density={config.density}
- columnResizeMode={
- config.columnResizeMode as 'fit' | 'expand' | undefined
- }
- selectSubRows={config.selectSubRows}
- enableVirtualization={config.enableVirtualization}
- style={config.enableVirtualization ? { maxHeight: '90vh' } : undefined}
+ density={density}
+ columnResizeMode={columnResizeMode as 'fit' | 'expand' | undefined}
+ selectSubRows={selectSubRows}
+ enableVirtualization={enableVirtualization}
+ style={enableVirtualization ? { maxHeight: '90vh' } : undefined}
scrollToRow={
- config.scroll
+ scroll
? (rows, data) =>
- rows.findIndex((row) => row.original === data[config.scrollRow])
+ rows.findIndex((row) => row.original === data[scrollRow])
: undefined
}
stateReducer={
- config.stateReducer
+ stateReducer
? (newState, action, previousState, instance) => {
if (action.type === 'toggleRowSelected') {
console.log(action.value);
@@ -228,6 +245,8 @@ const WithTablePaginator = ({
}: {
config: ReturnType;
}) => {
+ const { density } = config;
+
const columns = React.useMemo(
() => [
{
@@ -274,7 +293,7 @@ const WithTablePaginator = ({
columns={columns}
data={data}
pageSize={50}
- density={config.density}
+ density={density}
paginatorRenderer={paginator}
/>
From 42bc28093918b9d894b4d67d3f701eb03b79a1e1 Mon Sep 17 00:00:00 2001
From: Rohan <45748283+rohan-kadkol@users.noreply.github.com>
Date: Fri, 30 Aug 2024 10:06:13 -0400
Subject: [PATCH 17/25] Fix test failures
---
testing/e2e/app/routes/Table/route.tsx | 36 ++++++++++++++------------
testing/e2e/app/routes/Table/spec.ts | 2 +-
2 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/testing/e2e/app/routes/Table/route.tsx b/testing/e2e/app/routes/Table/route.tsx
index 9121f9f7f52..e7d106b61e2 100644
--- a/testing/e2e/app/routes/Table/route.tsx
+++ b/testing/e2e/app/routes/Table/route.tsx
@@ -129,6 +129,24 @@ const Default = ({
stateReducer,
} = config;
+ const virtualizedData = React.useMemo(() => {
+ if (empty) {
+ return [];
+ }
+
+ const size = oneRow ? 1 : 100000;
+ const arr = new Array(size);
+ for (let i = 0; i < size; ++i) {
+ arr[i] = {
+ index: i,
+ name: `Name${i}`,
+ description: `Description${i}`,
+ id: i,
+ };
+ }
+ return arr;
+ }, [oneRow, empty]);
+
const data = subRows ? dataWithSubrows : baseData;
const isRowDisabled = React.useCallback(
@@ -138,22 +156,6 @@ const Default = ({
[],
);
- const virtualizedData = React.useMemo(() => {
- const size = oneRow ? 1 : 100000;
- const arr = new Array(size);
- if (!empty) {
- for (let i = 0; i < size; ++i) {
- arr[i] = {
- index: i,
- name: `Name${i}`,
- description: `Description${i}`,
- id: i,
- };
- }
- }
- return arr;
- }, [oneRow, empty]);
-
return (
<>
{
test.describe('Table filters', () => {
test('DateRangeFilter should show DatePicker', async ({ page }) => {
- await page.goto('/Table?allFilters=true');
+ await page.goto('/Table?exampleType=allFilters');
// open Date filter
const dateHeader = page.locator('[role="columnheader"]', {
From 1651f27b51c6d3ddcc5e55ffbb2a5a450e09ea2a Mon Sep 17 00:00:00 2001
From: Rohan <45748283+r100-stack@users.noreply.github.com>
Date: Thu, 26 Sep 2024 15:32:46 -0400
Subject: [PATCH 18/25] Fixed e2e test
---
testing/e2e/app/routes/Table/route.tsx | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/testing/e2e/app/routes/Table/route.tsx b/testing/e2e/app/routes/Table/route.tsx
index 732972a1d1c..09c967ca4ff 100644
--- a/testing/e2e/app/routes/Table/route.tsx
+++ b/testing/e2e/app/routes/Table/route.tsx
@@ -95,7 +95,7 @@ const getConfigFromSearchParams = (searchParams: URLSearchParams) => {
minWidths,
density,
isSelectable,
- subRows,
+ rows,
filter,
selectSubRows,
enableVirtualization,
@@ -104,6 +104,7 @@ const getConfigFromSearchParams = (searchParams: URLSearchParams) => {
oneRow,
stateReducer,
scrollRow,
+ hasSubComponent,
};
};
@@ -113,7 +114,6 @@ const Default = ({
config: ReturnType;
}) => {
const {
- subRows,
oneRow,
empty,
columnResizeMode,
@@ -128,6 +128,8 @@ const Default = ({
scrollRow,
selectSubRows,
stateReducer,
+ rows,
+ hasSubComponent,
} = config;
const virtualizedData = React.useMemo(() => {
From f55d709bd581ff471cd55649271e35a94d4325a4 Mon Sep 17 00:00:00 2001
From: Rohan <45748283+r100-stack@users.noreply.github.com>
Date: Mon, 30 Sep 2024 16:30:51 -0400
Subject: [PATCH 19/25] Improvements
---
testing/e2e/app/routes/ComboBox/spec.ts | 42 ++++++++++++-------------
1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/testing/e2e/app/routes/ComboBox/spec.ts b/testing/e2e/app/routes/ComboBox/spec.ts
index 5d872340dc6..26184686492 100644
--- a/testing/e2e/app/routes/ComboBox/spec.ts
+++ b/testing/e2e/app/routes/ComboBox/spec.ts
@@ -21,11 +21,13 @@ test.describe('ComboBox (general)', () => {
await option.click();
}
- const tags = await getSelectTagContainerTags(page);
- expect(tags).toHaveLength(options.length);
+ const tags = getSelectTagContainerTags(page);
+ expect(tags).toHaveCount(options.length);
- for (let i = 0; i < tags.length; i++) {
- await expect(tags[i]).toHaveText((await options[i].textContent()) ?? '');
+ for (let i = 0; i < (await tags.count()); i++) {
+ await expect(tags.nth(i)).toHaveText(
+ (await options[i].textContent()) ?? '',
+ );
}
});
@@ -39,20 +41,20 @@ test.describe('ComboBox (general)', () => {
await page.waitForTimeout(200);
+ let tags = getSelectTagContainerTags(page);
+
// Should change internal state when the value prop changes
if (multiple) {
- let tags = await getSelectTagContainerTags(page);
- expect(tags).toHaveLength(defaultOptions.length);
+ expect(tags).toHaveCount(defaultOptions.length);
- for (let i = 0; i < tags.length; i++) {
- await expect(tags[i]).toHaveText(defaultOptions[i].label);
+ for (let i = 0; i < (await tags.count()); i++) {
+ await expect(tags.nth(i)).toHaveText(defaultOptions[i].label);
}
await page.getByTestId('change-value-to-first-option-button').click();
- tags = await getSelectTagContainerTags(page);
- expect(tags).toHaveLength(1);
- await expect(tags[0]).toHaveText(defaultOptions[0].label);
+ expect(tags).toHaveCount(1);
+ await expect(tags.first()).toHaveText(defaultOptions[0].label);
} else {
await expect(page.locator('input')).toHaveValue('Item 11');
await page.getByTestId('change-value-to-first-option-button').click();
@@ -65,10 +67,8 @@ test.describe('ComboBox (general)', () => {
await page.getByRole('option').nth(3).click();
if (multiple) {
- const tags = await getSelectTagContainerTags(page);
-
- expect(tags).toHaveLength(1);
- await expect(tags[0]).toHaveText(defaultOptions[0].label);
+ expect(tags).toHaveCount(1);
+ await expect(tags.first()).toHaveText(defaultOptions[0].label);
} else {
await expect(page.locator('input')).toHaveValue('Item 0');
}
@@ -342,18 +342,18 @@ const expectOverflowState = async ({
expectedItemLength: number;
expectedLastTagTextContent: string | undefined;
}) => {
- const tags = await getSelectTagContainerTags(page);
- expect(tags).toHaveLength(expectedItemLength);
+ const tags = getSelectTagContainerTags(page);
+ expect(tags).toHaveCount(expectedItemLength);
- const lastTag = tags[tags.length - 1];
+ const lastTag = tags.nth((await tags.count()) - 1);
if (expectedLastTagTextContent != null) {
await expect(lastTag).toHaveText(expectedLastTagTextContent);
} else {
- expect(tags).toHaveLength(0);
+ expect(tags).toHaveCount(0);
}
};
-const getSelectTagContainerTags = async (page: Page) => {
- return await page.locator('span[class$="-select-tag"]').all();
+const getSelectTagContainerTags = (page: Page) => {
+ return page.getByRole('combobox').locator('+ div > span');
};
From b7c05aecd2744766796bf8af42582d4a1a71aae2 Mon Sep 17 00:00:00 2001
From: Rohan <45748283+r100-stack@users.noreply.github.com>
Date: Mon, 30 Sep 2024 16:33:56 -0400
Subject: [PATCH 20/25] Simplicity
---
testing/e2e/app/routes/ComboBox/spec.ts | 96 ++++++++++++-------------
1 file changed, 47 insertions(+), 49 deletions(-)
diff --git a/testing/e2e/app/routes/ComboBox/spec.ts b/testing/e2e/app/routes/ComboBox/spec.ts
index 26184686492..38cb785205f 100644
--- a/testing/e2e/app/routes/ComboBox/spec.ts
+++ b/testing/e2e/app/routes/ComboBox/spec.ts
@@ -10,69 +10,67 @@ const defaultOptions = [
{ label: 'Item 11', value: 11 },
];
-test.describe('ComboBox (general)', () => {
- test('should select multiple options', async ({ page }) => {
- await page.goto('/ComboBox?multiple=true');
+test('should select multiple options', async ({ page }) => {
+ await page.goto('/ComboBox?multiple=true');
- await page.keyboard.press('Tab');
+ await page.keyboard.press('Tab');
- const options = await page.locator('[role="option"]').all();
- for (const option of options) {
- await option.click();
- }
+ const options = await page.locator('[role="option"]').all();
+ for (const option of options) {
+ await option.click();
+ }
- const tags = getSelectTagContainerTags(page);
- expect(tags).toHaveCount(options.length);
+ const tags = getSelectTagContainerTags(page);
+ expect(tags).toHaveCount(options.length);
- for (let i = 0; i < (await tags.count()); i++) {
- await expect(tags.nth(i)).toHaveText(
- (await options[i].textContent()) ?? '',
- );
- }
- });
+ for (let i = 0; i < (await tags.count()); i++) {
+ await expect(tags.nth(i)).toHaveText(
+ (await options[i].textContent()) ?? '',
+ );
+ }
+});
- [true, false].forEach((multiple) => {
- test(`should respect the value prop (${multiple})`, async ({ page }) => {
- await page.goto(
- `/ComboBox?multiple=${multiple}&initialValue=${
- multiple ? 'all' : 11
- }&showChangeValueButton=true`,
- );
+[true, false].forEach((multiple) => {
+ test(`should respect the value prop (${multiple})`, async ({ page }) => {
+ await page.goto(
+ `/ComboBox?multiple=${multiple}&initialValue=${
+ multiple ? 'all' : 11
+ }&showChangeValueButton=true`,
+ );
- await page.waitForTimeout(200);
+ await page.waitForTimeout(200);
- let tags = getSelectTagContainerTags(page);
+ let tags = getSelectTagContainerTags(page);
- // Should change internal state when the value prop changes
- if (multiple) {
- expect(tags).toHaveCount(defaultOptions.length);
+ // Should change internal state when the value prop changes
+ if (multiple) {
+ expect(tags).toHaveCount(defaultOptions.length);
- for (let i = 0; i < (await tags.count()); i++) {
- await expect(tags.nth(i)).toHaveText(defaultOptions[i].label);
- }
+ for (let i = 0; i < (await tags.count()); i++) {
+ await expect(tags.nth(i)).toHaveText(defaultOptions[i].label);
+ }
- await page.getByTestId('change-value-to-first-option-button').click();
+ await page.getByTestId('change-value-to-first-option-button').click();
- expect(tags).toHaveCount(1);
- await expect(tags.first()).toHaveText(defaultOptions[0].label);
- } else {
- await expect(page.locator('input')).toHaveValue('Item 11');
- await page.getByTestId('change-value-to-first-option-button').click();
- await expect(page.locator('input')).toHaveValue('Item 0');
- }
+ expect(tags).toHaveCount(1);
+ await expect(tags.first()).toHaveText(defaultOptions[0].label);
+ } else {
+ await expect(page.locator('input')).toHaveValue('Item 11');
+ await page.getByTestId('change-value-to-first-option-button').click();
+ await expect(page.locator('input')).toHaveValue('Item 0');
+ }
- // Should not allow to select other options
- await page.keyboard.press('Tab');
+ // Should not allow to select other options
+ await page.keyboard.press('Tab');
- await page.getByRole('option').nth(3).click();
+ await page.getByRole('option').nth(3).click();
- if (multiple) {
- expect(tags).toHaveCount(1);
- await expect(tags.first()).toHaveText(defaultOptions[0].label);
- } else {
- await expect(page.locator('input')).toHaveValue('Item 0');
- }
- });
+ if (multiple) {
+ expect(tags).toHaveCount(1);
+ await expect(tags.first()).toHaveText(defaultOptions[0].label);
+ } else {
+ await expect(page.locator('input')).toHaveValue('Item 0');
+ }
});
});
From 3e82ea531c616116486ae82b5fba46d34934fdbb Mon Sep 17 00:00:00 2001
From: Rohan <45748283+r100-stack@users.noreply.github.com>
Date: Mon, 30 Sep 2024 16:46:01 -0400
Subject: [PATCH 21/25] Improvements
---
testing/e2e/app/routes/ComboBox/route.tsx | 103 +++++++++++++++++-----
testing/e2e/app/routes/ComboBox/spec.ts | 39 ++++++--
2 files changed, 113 insertions(+), 29 deletions(-)
diff --git a/testing/e2e/app/routes/ComboBox/route.tsx b/testing/e2e/app/routes/ComboBox/route.tsx
index 6ca62b82520..234a7ab0b67 100644
--- a/testing/e2e/app/routes/ComboBox/route.tsx
+++ b/testing/e2e/app/routes/ComboBox/route.tsx
@@ -3,8 +3,81 @@ import { useSearchParams } from '@remix-run/react';
import * as React from 'react';
export default function ComboBoxTest() {
+ const config = getConfigFromSearchParams();
+
+ if (config.exampleType === 'overflow') {
+ return ;
+ }
+ return ;
+}
+
+const Default = ({
+ config,
+}: {
+ config: ReturnType;
+}) => {
+ const {
+ initialValue,
+ multiple,
+ options,
+ showChangeValueButton,
+ virtualization,
+ } = config;
+ const [value, setValue] = React.useState(initialValue);
+
+ return (
+
+ {showChangeValueButton && (
+
+ )}
+
+
+
+ );
+};
+
+const Overflow = () => {
+ const data = new Array(15).fill(0).map((_, i) => ({
+ label: `option ${i}`,
+ value: i,
+ }));
+ const widths = new Array(10).fill(0).map((_, i) => 790 + i * 3);
+
+ return (
+ <>
+ {widths.slice(0, 10).map((width) => (
+ x.value)}
+ />
+ ))}
+ >
+ );
+};
+
+// ----------------------------------------------------------------------------
+
+function getConfigFromSearchParams() {
const [searchParams] = useSearchParams();
+ const exampleType = searchParams.get('exampleType') as
+ | 'default'
+ | 'overflow'
+ | undefined;
const virtualization = searchParams.get('virtualization') === 'true';
const multiple = searchParams.get('multiple') === 'true';
const showChangeValueButton =
@@ -30,26 +103,12 @@ export default function ComboBoxTest() {
: (JSON.parse(initialValueSearchParam) as number | number[])
: undefined;
- const [value, setValue] = React.useState(initialValue);
-
- return (
-
- {showChangeValueButton && (
-
- )}
-
-
-
- );
+ return {
+ exampleType,
+ virtualization,
+ multiple,
+ showChangeValueButton,
+ options,
+ initialValue,
+ };
}
diff --git a/testing/e2e/app/routes/ComboBox/spec.ts b/testing/e2e/app/routes/ComboBox/spec.ts
index 38cb785205f..bfacf120e78 100644
--- a/testing/e2e/app/routes/ComboBox/spec.ts
+++ b/testing/e2e/app/routes/ComboBox/spec.ts
@@ -21,7 +21,7 @@ test('should select multiple options', async ({ page }) => {
}
const tags = getSelectTagContainerTags(page);
- expect(tags).toHaveCount(options.length);
+ await expect(tags).toHaveCount(options.length);
for (let i = 0; i < (await tags.count()); i++) {
await expect(tags.nth(i)).toHaveText(
@@ -44,7 +44,7 @@ test('should select multiple options', async ({ page }) => {
// Should change internal state when the value prop changes
if (multiple) {
- expect(tags).toHaveCount(defaultOptions.length);
+ await expect(tags).toHaveCount(defaultOptions.length);
for (let i = 0; i < (await tags.count()); i++) {
await expect(tags.nth(i)).toHaveText(defaultOptions[i].label);
@@ -52,7 +52,7 @@ test('should select multiple options', async ({ page }) => {
await page.getByTestId('change-value-to-first-option-button').click();
- expect(tags).toHaveCount(1);
+ await expect(tags).toHaveCount(1);
await expect(tags.first()).toHaveText(defaultOptions[0].label);
} else {
await expect(page.locator('input')).toHaveValue('Item 11');
@@ -66,7 +66,7 @@ test('should select multiple options', async ({ page }) => {
await page.getByRole('option').nth(3).click();
if (multiple) {
- expect(tags).toHaveCount(1);
+ await expect(tags).toHaveCount(1);
await expect(tags.first()).toHaveText(defaultOptions[0].label);
} else {
await expect(page.locator('input')).toHaveValue('Item 0');
@@ -74,6 +74,31 @@ test('should select multiple options', async ({ page }) => {
});
});
+test('should not have flickering tags (fixes #2112)', async ({ page }) => {
+ await page.goto('/ComboBox?exampleType=overflow');
+
+ const selectTagContainers = page.locator(
+ "[role='combobox'] + div:first-of-type",
+ );
+
+ // Wait for page to stabilize
+ await expect(selectTagContainers).toHaveCount(10);
+ for (let i = 0; i < 10; i++) {
+ await expect(selectTagContainers.nth(i).locator('> span')).toHaveCount(
+ i < 5 ? 6 : 7,
+ );
+ }
+
+ // The number of items should not change with time (i.e. no flickering)
+ for (let iteration = 0; iteration < 10; iteration++) {
+ for (let i = 0; i < 10; i++) {
+ expect(selectTagContainers.nth(i).locator('> span')).toHaveCount(
+ i < 5 ? 6 : 7,
+ );
+ }
+ }
+});
+
test.describe('ComboBox (virtualization)', () => {
test('should support keyboard navigation when virtualization is enabled', async ({
page,
@@ -341,14 +366,14 @@ const expectOverflowState = async ({
expectedLastTagTextContent: string | undefined;
}) => {
const tags = getSelectTagContainerTags(page);
- expect(tags).toHaveCount(expectedItemLength);
+ await expect(tags).toHaveCount(expectedItemLength);
- const lastTag = tags.nth((await tags.count()) - 1);
+ const lastTag = tags.last();
if (expectedLastTagTextContent != null) {
await expect(lastTag).toHaveText(expectedLastTagTextContent);
} else {
- expect(tags).toHaveCount(0);
+ await expect(tags).toHaveCount(0);
}
};
From aa8b849b88c1d8c6e044316697bc5f1538c8f01f Mon Sep 17 00:00:00 2001
From: Rohan <45748283+r100-stack@users.noreply.github.com>
Date: Tue, 1 Oct 2024 10:40:25 -0400
Subject: [PATCH 22/25] Remove unrelated test
---
testing/e2e/app/routes/ComboBox/route.tsx | 30 +----------------------
testing/e2e/app/routes/ComboBox/spec.ts | 25 -------------------
2 files changed, 1 insertion(+), 54 deletions(-)
diff --git a/testing/e2e/app/routes/ComboBox/route.tsx b/testing/e2e/app/routes/ComboBox/route.tsx
index 234a7ab0b67..89d348c86e6 100644
--- a/testing/e2e/app/routes/ComboBox/route.tsx
+++ b/testing/e2e/app/routes/ComboBox/route.tsx
@@ -5,9 +5,6 @@ import * as React from 'react';
export default function ComboBoxTest() {
const config = getConfigFromSearchParams();
- if (config.exampleType === 'overflow') {
- return ;
- }
return ;
}
@@ -47,37 +44,12 @@ const Default = ({
);
};
-const Overflow = () => {
- const data = new Array(15).fill(0).map((_, i) => ({
- label: `option ${i}`,
- value: i,
- }));
- const widths = new Array(10).fill(0).map((_, i) => 790 + i * 3);
-
- return (
- <>
- {widths.slice(0, 10).map((width) => (
- x.value)}
- />
- ))}
- >
- );
-};
-
// ----------------------------------------------------------------------------
function getConfigFromSearchParams() {
const [searchParams] = useSearchParams();
- const exampleType = searchParams.get('exampleType') as
- | 'default'
- | 'overflow'
- | undefined;
+ const exampleType = searchParams.get('exampleType') as 'default' | undefined;
const virtualization = searchParams.get('virtualization') === 'true';
const multiple = searchParams.get('multiple') === 'true';
const showChangeValueButton =
diff --git a/testing/e2e/app/routes/ComboBox/spec.ts b/testing/e2e/app/routes/ComboBox/spec.ts
index bfacf120e78..81d408ae929 100644
--- a/testing/e2e/app/routes/ComboBox/spec.ts
+++ b/testing/e2e/app/routes/ComboBox/spec.ts
@@ -74,31 +74,6 @@ test('should select multiple options', async ({ page }) => {
});
});
-test('should not have flickering tags (fixes #2112)', async ({ page }) => {
- await page.goto('/ComboBox?exampleType=overflow');
-
- const selectTagContainers = page.locator(
- "[role='combobox'] + div:first-of-type",
- );
-
- // Wait for page to stabilize
- await expect(selectTagContainers).toHaveCount(10);
- for (let i = 0; i < 10; i++) {
- await expect(selectTagContainers.nth(i).locator('> span')).toHaveCount(
- i < 5 ? 6 : 7,
- );
- }
-
- // The number of items should not change with time (i.e. no flickering)
- for (let iteration = 0; iteration < 10; iteration++) {
- for (let i = 0; i < 10; i++) {
- expect(selectTagContainers.nth(i).locator('> span')).toHaveCount(
- i < 5 ? 6 : 7,
- );
- }
- }
-});
-
test.describe('ComboBox (virtualization)', () => {
test('should support keyboard navigation when virtualization is enabled', async ({
page,
From 314aac7eb46da90782bbc12c78cee6f71fdfb64c Mon Sep 17 00:00:00 2001
From: Rohan <45748283+r100-stack@users.noreply.github.com>
Date: Tue, 1 Oct 2024 12:41:16 -0400
Subject: [PATCH 23/25] Reduce diff
---
testing/e2e/app/routes/DropdownMenu/spec.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testing/e2e/app/routes/DropdownMenu/spec.ts b/testing/e2e/app/routes/DropdownMenu/spec.ts
index 9ee0974679c..35437928266 100644
--- a/testing/e2e/app/routes/DropdownMenu/spec.ts
+++ b/testing/e2e/app/routes/DropdownMenu/spec.ts
@@ -309,7 +309,7 @@ test.describe('DropdownMenu', () => {
await page.locator('button').first().click();
await page.locator('button').nth(10).scrollIntoViewIfNeeded();
- await expect(page.getByRole('menu')).toBeVisible();
+ await expect(page.getByRole('menu')).toHaveCount(1);
});
});
From c67f2ff48acf000a0cf3c9627a9118b4912952d2 Mon Sep 17 00:00:00 2001
From: Rohan <45748283+r100-stack@users.noreply.github.com>
Date: Wed, 2 Oct 2024 16:15:56 -0400
Subject: [PATCH 24/25] Update outdated test
---
testing/e2e/app/routes/Table/spec.ts | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/testing/e2e/app/routes/Table/spec.ts b/testing/e2e/app/routes/Table/spec.ts
index 9cc5355ac26..2115b181f5e 100644
--- a/testing/e2e/app/routes/Table/spec.ts
+++ b/testing/e2e/app/routes/Table/spec.ts
@@ -473,7 +473,15 @@ test.describe('Table Paginator', () => {
const paginatorButtons = page.locator('#paginator button', {
hasText: /[0-9]+/,
});
- await expect(paginatorButtons).toHaveText(['1', '5', '6', '7', '11']);
+ await expect(paginatorButtons).toHaveText([
+ '1',
+ '4',
+ '5',
+ '6',
+ '7',
+ '8',
+ '11',
+ ]);
await expect(paginatorButtons.nth(2)).toHaveAttribute(
'data-iui-active',
'true',
From 557e096e61affb8648a54cd82c9fefe94c038b78 Mon Sep 17 00:00:00 2001
From: Rohan <45748283+r100-stack@users.noreply.github.com>
Date: Wed, 2 Oct 2024 16:30:57 -0400
Subject: [PATCH 25/25] Fix test
---
testing/e2e/app/routes/Table/spec.ts | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/testing/e2e/app/routes/Table/spec.ts b/testing/e2e/app/routes/Table/spec.ts
index 2115b181f5e..9cc5355ac26 100644
--- a/testing/e2e/app/routes/Table/spec.ts
+++ b/testing/e2e/app/routes/Table/spec.ts
@@ -473,15 +473,7 @@ test.describe('Table Paginator', () => {
const paginatorButtons = page.locator('#paginator button', {
hasText: /[0-9]+/,
});
- await expect(paginatorButtons).toHaveText([
- '1',
- '4',
- '5',
- '6',
- '7',
- '8',
- '11',
- ]);
+ await expect(paginatorButtons).toHaveText(['1', '5', '6', '7', '11']);
await expect(paginatorButtons.nth(2)).toHaveAttribute(
'data-iui-active',
'true',