Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump eslint-plugin-testing-library from 5.11.1 to 6.2.2 #43696

Merged
Merged
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
2 changes: 1 addition & 1 deletion web/packages/build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"eslint-plugin-jest-dom": "^5.4.0",
"eslint-plugin-react": "^7.34.2",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-testing-library": "^5.11.1",
"eslint-plugin-testing-library": "^6.2.2",
"events": "3.3.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
Expand Down
4 changes: 2 additions & 2 deletions web/packages/teleport/src/Bots/List/BotList.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ test('renders View options if type is github actions ssh', async () => {
const props = makeProps();
props.bots = [bot];
render(<BotList {...props} />);
await fireEvent.click(await screen.findByText('OPTIONS'));
fireEvent.click(await screen.findByText('OPTIONS'));
expect(screen.getByText('View...')).toBeInTheDocument();
});

Expand All @@ -95,6 +95,6 @@ test('doesnt renders View options if bot type is not github actions', async () =
const props = makeProps();
props.bots = [bot];
render(<BotList {...props} />);
await fireEvent.click(await screen.findByText('OPTIONS'));
fireEvent.click(await screen.findByText('OPTIONS'));
expect(screen.queryByText('View...')).not.toBeInTheDocument();
});
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ test('create app access', async () => {
renderCreateAppAccess(ctx, discoverCtx);
await screen.findByText(/bash/i);

userEvent.click(screen.getByRole('button', { name: /next/i }));
await userEvent.click(screen.getByRole('button', { name: /next/i }));
await screen.findByText(/aws-console/i);
expect(integrationService.createAwsAppAccess).toHaveBeenCalledTimes(1);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ test('user acknowledging script was ran when s3 bucket fields are edited', async
// - checkbox to confirm user has ran command
// - edit button replaces generate command button
// - save button still disabled
userEvent.click(screen.getByRole('button', { name: /generate command/i }));
await userEvent.click(
screen.getByRole('button', { name: /generate command/i })
);
await screen.findByRole('button', { name: /edit/i });
expect(screen.getByRole('button', { name: /save/i })).toBeDisabled();
expect(
Expand All @@ -77,20 +79,20 @@ test('user acknowledging script was ran when s3 bucket fields are edited', async
expect(screen.getByTestId('scriptbox')).toBeInTheDocument();

// Click on checkbox should enable save button and disable edit button.
userEvent.click(screen.getByRole('checkbox'));
await userEvent.click(screen.getByRole('checkbox'));
await waitFor(() =>
expect(screen.getByRole('button', { name: /save/i })).toBeEnabled()
);
expect(screen.getByRole('button', { name: /edit/i })).toBeDisabled();

// Unchecking the checkbox should disable save button.
userEvent.click(screen.getByRole('checkbox'));
await userEvent.click(screen.getByRole('checkbox'));
await waitFor(() =>
expect(screen.getByRole('button', { name: /save/i })).toBeDisabled()
);

// Click on edit, should replace it with generate command
userEvent.click(screen.getByRole('button', { name: /edit/i }));
await userEvent.click(screen.getByRole('button', { name: /edit/i }));
await waitFor(() =>
expect(
screen.getByRole('button', { name: /generate command/i })
Expand Down Expand Up @@ -139,29 +141,31 @@ test('render warning on save when leaving s3 fields empty', async () => {
expect(screen.queryByLabelText(/I ran the command/i)).not.toBeInTheDocument();
expect(screen.getByRole('button', { name: /save/i })).toBeDisabled();

userEvent.click(screen.getByRole('button', { name: /generate command/i }));
await userEvent.click(
screen.getByRole('button', { name: /generate command/i })
);
await screen.findByRole('button', { name: /edit/i });
expect(screen.getByRole('button', { name: /save/i })).toBeDisabled();

userEvent.click(screen.getByLabelText(/I ran the command/i));
await userEvent.click(screen.getByLabelText(/I ran the command/i));
await waitFor(() =>
expect(screen.getByRole('button', { name: /save/i })).toBeEnabled()
);

// Clicking on save without defining s3 fields, should render
// a warning.
userEvent.click(screen.getByRole('button', { name: /save/i }));
await userEvent.click(screen.getByRole('button', { name: /save/i }));
await screen.findByText(/recommended to use an S3 bucket/i);
expect(edit).not.toHaveBeenCalled();

// Canceling and saving should re-render the warning.
userEvent.click(screen.getByRole('button', { name: /cancel/i }));
await userEvent.click(screen.getByRole('button', { name: /cancel/i }));
await screen.findByRole('button', { name: /save/i });

userEvent.click(screen.getByRole('button', { name: /save/i }));
await userEvent.click(screen.getByRole('button', { name: /save/i }));
await screen.findByText(/recommended to use an S3 bucket/i);

userEvent.click(screen.getByRole('button', { name: /continue/i }));
await userEvent.click(screen.getByRole('button', { name: /continue/i }));
await waitFor(() => expect(edit).toHaveBeenCalledTimes(1));
});

Expand Down Expand Up @@ -205,24 +209,26 @@ test('render warning on save when deleting existing s3 fields', async () => {
expect(screen.queryByLabelText(/I ran the command/i)).not.toBeInTheDocument();
expect(screen.getByRole('button', { name: /save/i })).toBeDisabled();

userEvent.click(screen.getByRole('button', { name: /generate command/i }));
await userEvent.click(
screen.getByRole('button', { name: /generate command/i })
);
await screen.findByRole('button', { name: /edit/i });
expect(screen.getByRole('button', { name: /save/i })).toBeDisabled();

userEvent.click(screen.getByLabelText(/I ran the command/i));
await userEvent.click(screen.getByLabelText(/I ran the command/i));
await waitFor(() =>
expect(screen.getByRole('button', { name: /save/i })).toBeEnabled()
);

// Test for warning render.
userEvent.click(screen.getByRole('button', { name: /save/i }));
await userEvent.click(screen.getByRole('button', { name: /save/i }));
await screen.findByText(/recommended to use an S3 bucket/i);
expect(edit).not.toHaveBeenCalled();
expect(
screen.getByText(/recommended to use an S3 bucket/i)
).toBeInTheDocument();

userEvent.click(screen.getByRole('button', { name: /continue/i }));
await userEvent.click(screen.getByRole('button', { name: /continue/i }));
await waitFor(() => expect(edit).toHaveBeenCalledTimes(1));
});

Expand All @@ -248,7 +254,9 @@ test('edit invalid fields', async () => {
).toBeEnabled()
);

userEvent.click(screen.getByRole('button', { name: /generate command/i }));
await userEvent.click(
screen.getByRole('button', { name: /generate command/i })
);
await screen.findByText(/invalid role ARN format/i);
});

Expand Down Expand Up @@ -283,14 +291,16 @@ test('edit submit called with proper fields', async () => {
).toBeEnabled()
);

userEvent.click(screen.getByRole('button', { name: /generate command/i }));
await userEvent.click(
screen.getByRole('button', { name: /generate command/i })
);
await screen.findByRole('button', { name: /edit/i });

userEvent.click(screen.getByLabelText(/I ran the command/i));
await userEvent.click(screen.getByLabelText(/I ran the command/i));
await waitFor(() =>
expect(screen.getByRole('button', { name: /save/i })).toBeEnabled()
);
userEvent.click(screen.getByRole('button', { name: /save/i }));
await userEvent.click(screen.getByRole('button', { name: /save/i }));
await waitFor(() => expect(mockEditFn).toHaveBeenCalledTimes(1));

expect(mockEditFn).toHaveBeenCalledWith({
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7301,10 +7301,10 @@ eslint-plugin-react@^7.34.2:
semver "^6.3.1"
string.prototype.matchall "^4.0.11"

eslint-plugin-testing-library@^5.11.1:
version "5.11.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-testing-library/-/eslint-plugin-testing-library-5.11.1.tgz#5b46cdae96d4a78918711c0b4792f90088e62d20"
integrity sha512-5eX9e1Kc2PqVRed3taaLnAAqPZGEX75C+M/rXzUAI3wIg/ZxzUm1OVAwfe/O+vE+6YXOLetSe9g5GKD2ecXipw==
eslint-plugin-testing-library@^6.2.2:
version "6.2.2"
resolved "https://registry.yarnpkg.com/eslint-plugin-testing-library/-/eslint-plugin-testing-library-6.2.2.tgz#67e84ff891a2b3a8078ced0afa95ee6f343c00c1"
integrity sha512-1E94YOTUDnOjSLyvOwmbVDzQi/WkKm3WVrMXu6SmBr6DN95xTGZmI6HJ/eOkSXh/DlheRsxaPsJvZByDBhWLVQ==
dependencies:
"@typescript-eslint/utils" "^5.58.0"

Expand Down
Loading