2023-06-30 05:38:33 -05:00
|
|
|
/////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// pgAdmin 4 - PostgreSQL Tools
|
|
|
|
//
|
2024-01-01 02:43:48 -06:00
|
|
|
// Copyright (C) 2013 - 2024, The pgAdmin Development Team
|
2023-06-30 05:38:33 -05:00
|
|
|
// This software is released under the PostgreSQL Licence
|
|
|
|
//
|
|
|
|
//////////////////////////////////////////////////////////////
|
|
|
|
|
2023-10-23 07:13:17 -05:00
|
|
|
|
2023-06-30 05:38:33 -05:00
|
|
|
import React from 'react';
|
2023-10-23 07:13:17 -05:00
|
|
|
|
|
|
|
import { render } from '@testing-library/react';
|
2023-06-30 05:38:33 -05:00
|
|
|
import Theme from '../../../pgadmin/static/js/Theme';
|
|
|
|
import PasswordResetPage from '../../../pgadmin/static/js/SecurityPages/PasswordResetPage';
|
|
|
|
|
|
|
|
describe('PasswordResetPage', ()=>{
|
|
|
|
|
|
|
|
|
|
|
|
let ctrlMount = (props)=>{
|
2023-10-23 07:13:17 -05:00
|
|
|
return render(<Theme>
|
2023-06-30 05:38:33 -05:00
|
|
|
<PasswordResetPage {...props}/>
|
|
|
|
</Theme>);
|
|
|
|
};
|
|
|
|
|
|
|
|
it('basic', (done)=>{
|
|
|
|
const ctrl = ctrlMount({
|
|
|
|
actionUrl: '/reset/url',
|
|
|
|
csrfToken: 'some-token',
|
|
|
|
});
|
|
|
|
setTimeout(()=>{
|
2023-10-23 07:13:17 -05:00
|
|
|
expect(ctrl.container.querySelector('form').getAttribute('action')).toBe('/reset/url');
|
|
|
|
expect(ctrl.container.querySelector('input[name="password"]')).not.toBeNull();
|
|
|
|
expect(ctrl.container.querySelector('input[name="password_confirm"]')).not.toBeNull();
|
|
|
|
|
2023-06-30 05:38:33 -05:00
|
|
|
done();
|
|
|
|
}, 100);
|
|
|
|
});
|
|
|
|
});
|