Skip to content

🐛 [BUG] 9 Test Failures - Tests out of sync with UI #4

@codeme-ne

Description

@codeme-ne

Problem

Running npm test results in 9 test failures across 5 test suites.

Evidence

$ npm test

Test Suites: 5 failed, 2 passed, 7 total
Tests:       9 failed, 43 passed, 52 total

Failed Test Suites:

  1. jest.setup.test.js
  2. __tests__/config/environment.test.ts
  3. __tests__/Home.test.tsx
  4. __tests__/components/ChatInterface.test.tsx
  5. __tests__/components/FileUpload.test.tsx

Root Cause Analysis

Tests are out of sync with the actual UI:

Test expects: "Dokument zum Lernen hochladen"
UI shows:     "Datei hochladen"

The component text was changed but tests weren't updated.

Working Checks

Required Fixes

1. FileUpload.test.tsx

Update text matchers to match current UI:

// Before
expect(screen.getByText(/Dokument zum Lernen hochladen/i)).toBeInTheDocument();

// After
expect(screen.getByText(/Datei hochladen/i)).toBeInTheDocument();

2. Review All Failed Tests

Each failed test needs to be checked against the current UI/behavior.

3. Consider Test Refactoring

  • Use data-testid attributes instead of text matching
  • This prevents tests from breaking when UI text changes

Impact

HIGH - Failing tests make CI/CD unreliable and signal poor code quality to recruiters reviewing the repo.

Priority

P1 - Must fix before showcasing as portfolio project.


This issue was created as part of portfolio cleanup for AI Automations SE applications.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions