Skip to content

Commit

Permalink
Remove unrelated test
Browse files Browse the repository at this point in the history
  • Loading branch information
r100-stack committed Oct 1, 2024
1 parent 3e82ea5 commit aa8b849
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 54 deletions.
30 changes: 1 addition & 29 deletions testing/e2e/app/routes/ComboBox/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ import * as React from 'react';
export default function ComboBoxTest() {
const config = getConfigFromSearchParams();

if (config.exampleType === 'overflow') {
return <Overflow />;
}
return <Default config={config} />;
}

Expand Down Expand Up @@ -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) => (
<ComboBox
key={width}
style={{ width: `${width}px`, maxWidth: '80vw' }}
multiple={true}
options={data}
value={data.map((x) => 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 =
Expand Down
25 changes: 0 additions & 25 deletions testing/e2e/app/routes/ComboBox/spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit aa8b849

Please sign in to comment.