fix(test): replace meaningless assertions and silent skips with proper test semantics

- Replace 4x expect(true).toBe(true) in audit-logger.test.ts with
  applyAuditConfig() + app.getVersion call count assertions
- Replace if(!hasCredentials){return} pattern with it.skipIf() in
  3 integration test files (cleaner, erp-auth, extractor) so Vitest
  correctly reports 12 tests as "skipped" instead of "passed"
- Remove placeholder assertion from skipped update-service test

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Misaka
2026-04-04 21:11:12 +08:00
parent 5d8563a4c9
commit d7ebb10f38
5 changed files with 93 additions and 145 deletions

View File

@@ -15,19 +15,11 @@ describe('ERP Authentication Service (Integration)', () => {
const hasCredentials = !!(config.url && config.username && config.password)
beforeAll(() => {
if (!hasCredentials) {
console.warn('Skipping ERP auth tests: credentials not configured')
return
}
if (!hasCredentials) return
authService = new ErpAuthService(config)
})
it('should login successfully', async () => {
if (!hasCredentials) {
console.warn('Skipping test: ERP credentials not configured')
return
}
it.skipIf(!hasCredentials)('should login successfully', async () => {
const session = await authService.login()
expect(session).toBeDefined()
@@ -37,12 +29,7 @@ describe('ERP Authentication Service (Integration)', () => {
expect(session.isLoggedIn).toBe(true)
}, 30000)
it('should navigate to main page after login', async () => {
if (!hasCredentials) {
console.warn('Skipping test: ERP credentials not configured')
return
}
it.skipIf(!hasCredentials)('should navigate to main page after login', async () => {
const session = await authService.login()
const url = session.page.url()