Skip to content

Commit d18f7d0

Browse files
committed
chore: Remove redundant test for same password error
1 parent 3322257 commit d18f7d0

File tree

1 file changed

+0
-38
lines changed

1 file changed

+0
-38
lines changed

packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskResetPassword/__tests__/TaskResetPassword.test.tsx

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { ClerkAPIResponseError } from '@clerk/shared/error';
21
import userEvent from '@testing-library/user-event';
32
import { describe, expect, it } from 'vitest';
43

@@ -65,43 +64,6 @@ describe('TaskResetPassword', () => {
6564
});
6665
});
6766

68-
it('giving the same password as the current password, should show an error', async () => {
69-
const { wrapper, fixtures } = await createFixtures(f => {
70-
f.withUser({
71-
email_addresses: ['test@clerk.com'],
72-
identifier: 'test@clerk.com',
73-
tasks: [{ key: 'reset-password' }],
74-
});
75-
f.withPassword();
76-
});
77-
78-
const errJSON = {
79-
code: 'form_new_password_matches_current',
80-
long_message: 'New password cannot be the same as the current password.',
81-
message: 'New password cannot be the same as the current password.',
82-
meta: { param_name: 'newPassword' },
83-
};
84-
85-
fixtures.clerk.user?.updatePassword.mockResolvedValueOnce(
86-
new ClerkAPIResponseError('Error', {
87-
data: [errJSON],
88-
status: 422,
89-
}),
90-
);
91-
const { getByRole, userEvent, getByLabelText, findByText } = render(<TaskResetPassword />, { wrapper });
92-
await waitFor(() => getByRole('heading', { name: /Reset password/i }));
93-
94-
await userEvent.type(getByLabelText(/new password/i), 'itsthesamepassword');
95-
await userEvent.type(getByLabelText(/confirm password/i), 'itsthesamepassword');
96-
await userEvent.click(getByRole('button', { name: /reset password$/i }));
97-
expect(fixtures.clerk.user?.updatePassword).toHaveBeenCalledWith({
98-
newPassword: 'itsthesamepassword',
99-
signOutOfOtherSessions: true,
100-
});
101-
102-
await waitFor(() => expect(findByText(/new password cannot be the same as the current password/i)).toBeVisible());
103-
});
104-
10567
it('renders a hidden identifier field', async () => {
10668
const { wrapper } = await createFixtures(f => {
10769
f.withUser({

0 commit comments

Comments
 (0)