From 6b4c3d45ee931ab78d2ba90a03cab545fc5adbdf Mon Sep 17 00:00:00 2001 From: busya Date: Mon, 1 Jun 2026 15:49:37 +0300 Subject: [PATCH] =?UTF-8?q?fix(tests):=20fix=203=20stale=20test=20assertio?= =?UTF-8?q?ns=20=E2=80=94=206=20fail=20=E2=86=92=203=20fail?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed: - TargetSchemaHint: result.missing_columns → res?.missing_columns (component uses res?) - CorrectionCell: border-blue-300 → border-blue-600 (class changed) - TranslationPreview: @UX_STATE: → @UX_STATE (no colon per GRACE format) 3 remaining pre-existing failures (not from migration): - dashboard-profile-override (×2): vi.fn() mock call count race condition - dataset_review_workspace: waitFor timeout, unreachable DOM state Before: 641 pass / 6 fail After: 648 pass / 3 fail --- .../translate/__tests__/TargetSchemaHint.test.ts | 2 +- .../__tests__/test_correction_cell.svelte.js | 2 +- .../__tests__/test_translation_preview.svelte.js | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/frontend/src/lib/components/translate/__tests__/TargetSchemaHint.test.ts b/frontend/src/lib/components/translate/__tests__/TargetSchemaHint.test.ts index 7795545d..b6568737 100644 --- a/frontend/src/lib/components/translate/__tests__/TargetSchemaHint.test.ts +++ b/frontend/src/lib/components/translate/__tests__/TargetSchemaHint.test.ts @@ -106,7 +106,7 @@ describe('TargetSchemaHint Component', () => { expect(source).toContain("state === 'complete'"); expect(source).toContain('result?.all_present'); expect(source).toContain('result?.table_exists'); - expect(source).toContain('result.missing_columns'); + expect(source).toContain('res?.missing_columns'); }); // #endregion test_complete_state diff --git a/frontend/src/lib/components/translate/__tests__/test_correction_cell.svelte.js b/frontend/src/lib/components/translate/__tests__/test_correction_cell.svelte.js index d3e477c1..9510e092 100644 --- a/frontend/src/lib/components/translate/__tests__/test_correction_cell.svelte.js +++ b/frontend/src/lib/components/translate/__tests__/test_correction_cell.svelte.js @@ -68,7 +68,7 @@ describe('CorrectionCell Component', () => { expect(source).toContain('cursor-pointer hover:bg-blue-50'); // Editing mode expect(source).toContain("uxState === 'editing'"); - expect(source).toContain('border-blue-300'); + expect(source).toContain('border-blue-600'); // Saving mode expect(source).toContain("uxState === 'saving'"); expect(source).toContain('animate-spin'); diff --git a/frontend/src/lib/components/translate/__tests__/test_translation_preview.svelte.js b/frontend/src/lib/components/translate/__tests__/test_translation_preview.svelte.js index a59b82bb..f71cc7bd 100644 --- a/frontend/src/lib/components/translate/__tests__/test_translation_preview.svelte.js +++ b/frontend/src/lib/components/translate/__tests__/test_translation_preview.svelte.js @@ -20,12 +20,12 @@ describe('TranslationPreview Component', () => { it('contains required UX tags and contract annotations', () => { const source = fs.readFileSync(COMPONENT_PATH, 'utf-8'); - expect(source).toContain('@UX_STATE: idle'); - expect(source).toContain('@UX_STATE: loading'); - expect(source).toContain('@UX_STATE: preview_loaded'); - expect(source).toContain('@UX_STATE: preview_error'); - expect(source).toContain('@UX_STATE: accepted'); - expect(source).toContain('@UX_STATE: stale_config'); + expect(source).toContain('@UX_STATE idle'); + expect(source).toContain('@UX_STATE loading'); + expect(source).toContain('@UX_STATE preview_loaded'); + expect(source).toContain('@UX_STATE preview_error'); + expect(source).toContain('@UX_STATE accepted'); + expect(source).toContain('@UX_STATE stale_config'); expect(source).toContain('@UX_FEEDBACK'); expect(source).toContain('@UX_RECOVERY'); expect(source).toContain('fetchPreview');