mirror of
https://github.com/logto-io/logto.git
synced 2025-01-06 20:40:08 -05:00
fix(ui): fix ut
fix ut
This commit is contained in:
parent
d65ba52f03
commit
9ea6a8c8e9
1 changed files with 5 additions and 5 deletions
|
@ -21,12 +21,12 @@ describe('<ResetPassword />', () => {
|
|||
const { queryByText, container } = renderWithPageContext(<ResetPassword />);
|
||||
expect(container.querySelector('input[name="new-password"]')).not.toBeNull();
|
||||
expect(container.querySelector('input[name="confirm-new-password"]')).not.toBeNull();
|
||||
expect(queryByText('action.confirm')).not.toBeNull();
|
||||
expect(queryByText('action.save_password')).not.toBeNull();
|
||||
});
|
||||
|
||||
test('password are required', () => {
|
||||
const { queryByText, getByText } = renderWithPageContext(<ResetPassword />);
|
||||
const submitButton = getByText('action.confirm');
|
||||
const submitButton = getByText('action.save_password');
|
||||
fireEvent.click(submitButton);
|
||||
|
||||
expect(queryByText('password_required')).not.toBeNull();
|
||||
|
@ -35,7 +35,7 @@ describe('<ResetPassword />', () => {
|
|||
|
||||
test('password less than 6 chars should throw', () => {
|
||||
const { queryByText, getByText, container } = renderWithPageContext(<ResetPassword />);
|
||||
const submitButton = getByText('action.confirm');
|
||||
const submitButton = getByText('action.save_password');
|
||||
const passwordInput = container.querySelector('input[name="new-password"]');
|
||||
|
||||
if (passwordInput) {
|
||||
|
@ -62,7 +62,7 @@ describe('<ResetPassword />', () => {
|
|||
|
||||
test('password mismatch with confirmPassword should throw', () => {
|
||||
const { queryByText, getByText, container } = renderWithPageContext(<ResetPassword />);
|
||||
const submitButton = getByText('action.confirm');
|
||||
const submitButton = getByText('action.save_password');
|
||||
const passwordInput = container.querySelector('input[name="new-password"]');
|
||||
const confirmPasswordInput = container.querySelector('input[name="confirm-new-password"]');
|
||||
|
||||
|
@ -94,7 +94,7 @@ describe('<ResetPassword />', () => {
|
|||
|
||||
test('should submit properly', async () => {
|
||||
const { queryByText, getByText, container } = renderWithPageContext(<ResetPassword />);
|
||||
const submitButton = getByText('action.confirm');
|
||||
const submitButton = getByText('action.save_password');
|
||||
const passwordInput = container.querySelector('input[name="new-password"]');
|
||||
const confirmPasswordInput = container.querySelector('input[name="confirm-new-password"]');
|
||||
|
||||
|
|
Loading…
Reference in a new issue