fix: resolve final workbench review findings

This commit is contained in:
2026-07-19 20:20:09 +08:00
parent 43d0b9f049
commit 27ff659c30
12 changed files with 172 additions and 30 deletions

View File

@@ -51,6 +51,12 @@ describe('ServerLogin', () => {
it.each([
['', 'Enter a server address.'],
['http:// bad-server', 'Enter a valid HTTP or HTTPS server address.'],
[' https://example.com', 'Enter a valid HTTP or HTTPS server address.'],
['https://example.com/path with spaces', 'Enter a valid HTTP or HTTPS server address.'],
['https://example%20.com', 'Enter a valid HTTP or HTTPS server address.'],
['https://user:secret@example.com', 'Enter a valid HTTP or HTTPS server address.'],
['http://', 'Enter a valid HTTP or HTTPS server address.'],
['ftp://example.com', 'Enter a valid HTTP or HTTPS server address.'],
])('rejects an invalid server value: %s', async (server, error) => {
const onLogin = vi.fn();
render(ServerLogin, { props: { apiBase: 'http://localhost:8080', onLogin } });