Skip to content

Commit

Permalink
fix act warning
Browse files Browse the repository at this point in the history
  • Loading branch information
milan-deepfence committed Apr 10, 2024
1 parent 044c730 commit 2e12878
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ describe(`Component Table`, () => {

expect(queryByText('row id 2')).not.toBeInTheDocument();

await user.click(expanderButtons[1]);
user.click(expanderButtons[1]);

await waitFor(() => {
expect(getByText('row id 2')).toBeInTheDocument();
Expand All @@ -133,7 +133,7 @@ describe(`Component Table`, () => {
expect(getByTestId('pagination-prev')).toBeInTheDocument();
expect(getByRole('cell', { name: /fruit 0/i })).toBeInTheDocument();

await user.click(getByRole('button', { name: /2/i }));
user.click(getByRole('button', { name: /2/i }));

await waitFor(() => {
expect(queryByText('fruit 0')).not.toBeInTheDocument();
Expand Down Expand Up @@ -191,7 +191,7 @@ describe(`Component Table`, () => {
expect(getByTestId('pagination-prev')).toBeInTheDocument();
expect(getByRole('cell', { name: /fruit 0/i })).toBeInTheDocument();

await user.click(getByRole('button', { name: /2/i }));
user.click(getByRole('button', { name: /2/i }));

await waitFor(() => {
expect(queryByText('fruit 0')).not.toBeInTheDocument();
Expand Down Expand Up @@ -230,7 +230,7 @@ describe(`Component Table`, () => {
expect(rows[1].children.item(0)?.textContent).toEqual('0');
expect(rows[10].children.item(0)?.textContent).toEqual('9');
expect(getByTestId('column-unsorted-indicator-id')).toBeInTheDocument();
await user.click(getByRole('columnheader', { name: /id/i }));
user.click(getByRole('columnheader', { name: /id/i }));

await waitFor(() => {
const rows = getAllByRole('row');
Expand All @@ -242,7 +242,7 @@ describe(`Component Table`, () => {
expect(rows[10].children.item(0)?.textContent).toEqual('90');
});

await user.click(getByRole('columnheader', { name: /id/i }));
user.click(getByRole('columnheader', { name: /id/i }));

await waitFor(() => {
const rows = getAllByRole('row');
Expand All @@ -254,7 +254,7 @@ describe(`Component Table`, () => {
expect(rows[10].children.item(0)?.textContent).toEqual('9');
});

await user.click(getByRole('columnheader', { name: /id/i }));
user.click(getByRole('columnheader', { name: /id/i }));

await waitFor(() => {
const rows = getAllByRole('row');
Expand Down Expand Up @@ -311,7 +311,7 @@ describe(`Component Table`, () => {
expect(rows[1].children.item(0)?.textContent).toEqual('0');
expect(rows[10].children.item(0)?.textContent).toEqual('9');
expect(getByTestId('column-unsorted-indicator-id')).toBeInTheDocument();
await user.click(getByRole('columnheader', { name: /id/i }));
user.click(getByRole('columnheader', { name: /id/i }));

await waitFor(() => {
const rows = getAllByRole('row');
Expand All @@ -323,7 +323,7 @@ describe(`Component Table`, () => {
expect(rows[10].children.item(0)?.textContent).toEqual('90');
});

await user.click(getByRole('columnheader', { name: /id/i }));
user.click(getByRole('columnheader', { name: /id/i }));

await waitFor(() => {
const rows = getAllByRole('row');
Expand All @@ -335,7 +335,7 @@ describe(`Component Table`, () => {
expect(rows[10].children.item(0)?.textContent).toEqual('9');
});

await user.click(getByRole('columnheader', { name: /id/i }));
user.click(getByRole('columnheader', { name: /id/i }));

await waitFor(() => {
const rows = getAllByRole('row');
Expand Down Expand Up @@ -384,22 +384,22 @@ describe(`Component Table`, () => {
expect(checkboxes.length).toEqual(10);
expect(getByTestId('selected-rows')).toHaveTextContent('');

await user.click(checkboxes[4]);
user.click(checkboxes[4]);

await waitFor(() => {
expect(getByTestId('selected-rows').textContent).toContain(`"id-4"`);
});

[selectAllCheckBox, ...checkboxes] = getAllByRole('checkbox');
await user.click(checkboxes[5]);
user.click(checkboxes[5]);

await waitFor(() => {
expect(getByTestId('selected-rows').textContent).toContain(`"id-4"`);
expect(getByTestId('selected-rows').textContent).toContain(`"id-5"`);
});

[selectAllCheckBox, ...checkboxes] = getAllByRole('checkbox');
await user.click(selectAllCheckBox);
user.click(selectAllCheckBox);

await waitFor(() => {
checkboxes.slice(checkboxes.length - 1).forEach((checkbox, index) => {
Expand Down

0 comments on commit 2e12878

Please sign in to comment.