fix(login): move remember password below submit

This commit is contained in:
2026-08-21 00:46:57 +08:00
parent eedd20d061
commit 4d512b15f6
4 changed files with 69 additions and 5 deletions

View File

@@ -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();
});