fix(login): move remember password below submit
This commit is contained in:
@@ -108,7 +108,13 @@ describe('Login page', () => {
|
||||
expect(screen.getByRole('tab', { name: '验证码登录' })).toHaveAttribute('aria-selected', 'false');
|
||||
expect(screen.getByLabelText('用户名')).toHaveAttribute('autocomplete', 'username');
|
||||
expect(screen.getByLabelText('密码')).toHaveAttribute('autocomplete', 'current-password');
|
||||
expect(await screen.findByRole('checkbox', { name: '记住密码' })).toBeEnabled();
|
||||
const rememberPasswordCheckbox = await screen.findByRole('checkbox', { name: '记住密码' });
|
||||
const loginButton = screen.getByRole('button', { name: '登录' });
|
||||
expect(rememberPasswordCheckbox).toBeEnabled();
|
||||
expect(
|
||||
loginButton.compareDocumentPosition(rememberPasswordCheckbox)
|
||||
& Node.DOCUMENT_POSITION_FOLLOWING,
|
||||
).toBe(Node.DOCUMENT_POSITION_FOLLOWING);
|
||||
expect(screen.queryByText(/浏览器|微信|注册/)).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user