fix(test): add mock-driver tests for database services

- Add connected-path tests for mysql, sql-server, and postgresql using
  mocked drivers (mysql2/promise, mssql, pg) covering
  connect, query, transaction, and disconnect scenarios
- Fix tautological assertion in auth-flow.test.ts (hasError >= 0 was always true)
- Add tests/integration to vitest exclude list to prevent
  module cache pollution under isolate:false
- Set isolate to true for CI, false for local dev (was: isolate false)
This commit is contained in:
Misaka
2026-04-06 11:11:04 +08:00
parent 188117e5ce
commit fe6cdbf076
5 changed files with 574 additions and 35 deletions

View File

@@ -85,8 +85,10 @@ test.describe('Authentication Flow', () => {
const errorMessage = page.locator('.error, [role="alert"], .text-red')
const hasError = await errorMessage.count()
// Either error shown or still on login page
expect(hasError >= 0).toBe(true)
// Verify login was rejected: either error shown or still on login page
const loginDialog = page.locator('[data-testid="login-dialog"]')
const isStillOnLoginPage = await loginDialog.isVisible().catch(() => false)
expect(hasError > 0 || isStillOnLoginPage).toBe(true)
}
})
})