# Known Issues and Limitations

**Last Updated:** January 26, 2026  
**Project:** B2B Flight Ticketing UI

---

## Overview

This document tracks known issues, limitations, and technical debt in the B2B Flight Ticketing UI application. Issues are categorized by priority and impact.

---

## High Priority Issues

### 1. Test Execution Timeout

**Issue ID:** ISSUE-001  
**Category:** Testing  
**Severity:** High  
**Status:** Open

**Description:**  
The unit test suite times out after 34 seconds, preventing complete execution of all 749 tests. Only 626 tests (83.6%) execute before the timeout.

**Error Message:**
```
Chrome Headless 144.0.0.0 (Mac OS 10.15.7) ERROR
Disconnected, because no message in 30000 ms.
```

**Impact:**
- Cannot verify all tests pass
- Cannot generate code coverage report
- Blocks production deployment verification

**Root Cause:**
- Some tests may be causing browser disconnection
- Possible infinite loops or unresolved promises
- Karma timeout configuration may be too short

**Workaround:**
- Previous verification report shows 81.31% coverage
- Critical path functionality verified manually

**Recommended Fix:**
1. Investigate tests running near timeout point (test #626)
2. Increase Karma `browserNoActivityTimeout` configuration
3. Identify and fix hanging tests
4. Add test timeouts to prevent hangs

**Estimated Effort:** 1-2 days

---

### 2. Code Coverage Report Not Generated

**Issue ID:** ISSUE-002  
**Category:** Testing  
**Severity:** High  
**Status:** Open (Blocked by ISSUE-001)

**Description:**  
Code coverage report shows "Unknown% (0/0)" for all metrics due to test execution timeout.

**Impact:**
- Cannot verify 80% coverage target
- Cannot track coverage trends
- Blocks quality gate for production

**Root Cause:**
- Test execution timeout prevents coverage data collection
- Blocked by ISSUE-001

**Workaround:**
- Previous report (Jan 25, 2026) shows 81.31% coverage
- Assume coverage maintained since no major code changes

**Recommended Fix:**
- Fix ISSUE-001 first
- Re-run tests with coverage flag
- Verify coverage meets 80% target

**Estimated Effort:** 1 day (after ISSUE-001 fixed)

---

## Medium Priority Issues

### 3. Reports Component - Empty State Tests Failing

**Issue ID:** ISSUE-003  
**Category:** Testing  
**Severity:** Medium  
**Status:** Open

**Description:**  
Three tests in ReportsComponent fail due to missing DOM elements.

**Failed Tests:**
1. `should display empty state on mobile when no data`
2. `should display empty state on desktop when no data`
3. `should maintain table structure for screen readers`

**Error Message:**
```
Expected null to be truthy
```

**Impact:**
- Low - Component works correctly in application
- Tests verify edge cases and accessibility
- Does not block functionality

**Root Cause:**
- Test selectors may be incorrect
- Empty state component may not render in test environment
- Accessibility attributes may be missing in test DOM

**Recommended Fix:**
1. Review test selectors (data-cy attributes)
2. Ensure proper component rendering in TestBed
3. Add missing accessibility attributes if needed
4. Update test assertions

**Estimated Effort:** 4-6 hours

---

### 4. MainLayoutComponent - Responsive Tests Failing

**Issue ID:** ISSUE-004  
**Category:** Testing  
**Severity:** Medium  
**Status:** Open

**Description:**  
Nine tests in MainLayoutComponent fail due to test infrastructure issue with `spyOnProperty`.

**Failed Tests:**
1. `should determine sidebar mode based on screen width`
2. `should set mobile mode for small screens`
3. `should set collapsed mode for tablet screens`
4. `should set full mode for desktop screens`
5. `should update screen size on window resize`
6. `should close mobile sidebar when resizing to larger screen`
7. `should not close mobile sidebar when staying on mobile screen`
8. `should show mobile menu button on mobile`
9. `should show sidebar overlay when mobile sidebar is open`

**Error Message:**
```
Error: <spyOnProperty> : Property innerWidth does not have access type get
Usage: spyOnProperty(<object>, <propName>, [accessType])
```

**Impact:**
- Low - Component works correctly in application
- Tests verify responsive behavior
- Does not block functionality

**Root Cause:**
- `window.innerWidth` doesn't have a getter accessor in test environment
- `spyOnProperty` requires accessor properties
- Test approach needs update

**Recommended Fix:**
Use `Object.defineProperty` instead of `spyOnProperty`:

```typescript
// Before (failing)
spyOnProperty(window, 'innerWidth').and.returnValue(768);

// After (working)
Object.defineProperty(window, 'innerWidth', {
  writable: true,
  configurable: true,
  value: 768
});
```

**Estimated Effort:** 2-3 hours

---

### 5. Property-Based Tests Not Implemented

**Issue ID:** ISSUE-005  
**Category:** Testing  
**Severity:** Medium  
**Status:** Intentionally Skipped (MVP)

**Description:**  
All optional property test subtasks (marked with `*` in tasks.md) were intentionally skipped to accelerate MVP delivery. The design document defines 77 correctness properties.

**Impact:**
- Medium - Reduced test coverage for edge cases
- Properties verify universal correctness across all inputs
- Unit tests cover specific examples

**Skipped Property Tests:**
- Task 2.2: Authentication token storage
- Task 2.3: Role extraction from JWT
- Task 2.5: Protected route access control
- Task 2.7: Role-based menu filtering
- Task 3.4: Error handling consistency
- Task 4.2: Notification functionality
- Task 4.4: Loading indicator display
- And 70+ additional property tests

**Recommended Fix:**
Implement property tests in post-MVP phase, prioritizing:
1. Authentication and authorization properties
2. Form validation properties
3. State management properties
4. API integration properties

**Estimated Effort:** 2-3 weeks

---

### 6. E2E Tests Not Implemented

**Issue ID:** ISSUE-006  
**Category:** Testing  
**Severity:** Medium  
**Status:** Not Implemented (Optional Task)

**Description:**  
End-to-end tests using Cypress were not implemented for the MVP (Task 27).

**Impact:**
- Medium - No automated end-to-end verification
- Critical path verified through unit tests
- Manual testing required

**Missing E2E Tests:**
- Complete booking flow (search → passenger → payment → confirmation)
- Wallet top-up flow
- Booking cancellation flow
- Admin KYC verification flow

**Recommended Fix:**
1. Set up Cypress testing framework
2. Write E2E tests for critical user journeys
3. Integrate into CI/CD pipeline
4. Run on staging environment

**Estimated Effort:** 1-2 weeks

---

## Low Priority Issues

### 7. Test Execution Warnings

**Issue ID:** ISSUE-007  
**Category:** Testing  
**Severity:** Low  
**Status:** Open

**Description:**  
Several test warnings appear during execution:

1. `Spec 'LoginComponent Login Submission should set loading to true during login' has no expectations`
2. `Spec 'ApiService GET requests should remove leading slash from endpoint' has no expectations`

**Impact:**
- Very Low - Tests run but have no assertions
- May indicate incomplete test implementation
- Does not affect functionality

**Recommended Fix:**
- Add expectations to tests or remove them
- Review test implementation

**Estimated Effort:** 1-2 hours

---

### 8. Console Error Logs in Tests

**Issue ID:** ISSUE-008  
**Category:** Testing  
**Severity:** Low  
**Status:** Expected Behavior

**Description:**  
Many error logs appear in test output for error handling tests.

**Examples:**
```
ERROR: 'Authorization error:', HttpErrorResponse{...}
ERROR: 'Authentication error:', HttpErrorResponse{...}
ERROR: 'Server error:', HttpErrorResponse{...}
```

**Impact:**
- None - These are expected errors from error handling tests
- May clutter test output
- Does not affect functionality

**Recommended Fix:**
- Suppress expected error logs in tests
- Use `spyOn(console, 'error')` to silence
- Or accept as normal test behavior

**Estimated Effort:** 2-3 hours (optional)

---

## Limitations

### 1. Browser Compatibility Testing

**Limitation:** Only tested on Chrome Headless 144.0.0.0

**Impact:**
- Unknown compatibility with other browsers
- May have issues on Firefox, Safari, Edge
- Mobile browser compatibility unknown

**Recommendation:**
- Test on all supported browsers before production
- Test on real mobile devices
- Use BrowserStack or similar service

---

### 2. Accessibility Testing

**Limitation:** No formal accessibility testing performed

**Impact:**
- WCAG 2.1 AA compliance not verified
- Screen reader compatibility unknown
- Keyboard navigation not fully tested

**Recommendation:**
- Perform accessibility audit
- Test with screen readers (NVDA, JAWS, VoiceOver)
- Verify keyboard navigation
- Fix any accessibility issues

---

### 3. Performance Testing

**Limitation:** No load testing or performance benchmarking

**Impact:**
- Performance under load unknown
- Bundle size not optimized
- No performance baseline

**Recommendation:**
- Perform load testing
- Run Lighthouse audit
- Optimize bundle size
- Set performance budgets

---

### 4. Security Audit

**Limitation:** No third-party security audit performed

**Impact:**
- Security vulnerabilities may exist
- Penetration testing not done
- Compliance requirements not verified

**Recommendation:**
- Conduct third-party security audit
- Perform penetration testing
- Address findings before production

---

### 5. Production Monitoring

**Limitation:** No application monitoring configured

**Impact:**
- Cannot track errors in production
- No performance monitoring
- No user analytics

**Recommendation:**
- Set up error tracking (Sentry, Rollbar)
- Add performance monitoring
- Configure user analytics
- Set up alerting

---

## Technical Debt

### 1. Test Infrastructure Improvements

**Description:**  
Test setup could be improved with better mocking utilities and shared test fixtures.

**Impact:** Medium  
**Effort:** 1 week

**Recommendation:**
- Create shared test utilities
- Standardize mock data
- Improve test readability

---

### 2. Code Documentation

**Description:**  
Some complex components lack inline documentation.

**Impact:** Low  
**Effort:** 3-5 days

**Recommendation:**
- Add JSDoc comments to complex functions
- Document component inputs/outputs
- Add architecture decision records

---

### 3. Bundle Size Optimization

**Description:**  
Production bundle size not analyzed or optimized.

**Impact:** Medium  
**Effort:** 3-5 days

**Recommendation:**
- Run webpack bundle analyzer
- Identify large dependencies
- Implement code splitting
- Lazy load heavy components

---

### 4. Error Message Localization

**Description:**  
Error messages are hardcoded in English.

**Impact:** Low  
**Effort:** 1-2 weeks

**Recommendation:**
- Implement i18n framework
- Externalize error messages
- Support multiple languages

---

## Issue Tracking

### Summary by Priority

| Priority | Open | In Progress | Resolved | Total |
|----------|------|-------------|----------|-------|
| High     | 2    | 0           | 0        | 2     |
| Medium   | 5    | 0           | 0        | 5     |
| Low      | 2    | 0           | 0        | 2     |
| **Total**| **9**| **0**       | **0**    | **9** |

### Summary by Category

| Category | Open | In Progress | Resolved | Total |
|----------|------|-------------|----------|-------|
| Testing  | 7    | 0           | 0        | 7     |
| Other    | 2    | 0           | 0        | 2     |
| **Total**| **9**| **0**       | **0**    | **9** |

---

## Resolution Timeline

### Before Production Deployment

**Must Fix (High Priority):**
- ISSUE-001: Test execution timeout (1-2 days)
- ISSUE-002: Code coverage report (1 day)

**Should Fix (Medium Priority):**
- ISSUE-003: Reports component tests (4-6 hours)
- ISSUE-004: MainLayoutComponent tests (2-3 hours)

**Total Estimated Effort:** 3-4 days

### Post-MVP Phase

**Should Implement:**
- ISSUE-005: Property-based tests (2-3 weeks)
- ISSUE-006: E2E tests (1-2 weeks)

**Can Fix:**
- ISSUE-007: Test warnings (1-2 hours)
- ISSUE-008: Console error logs (2-3 hours)

**Total Estimated Effort:** 4-5 weeks

---

## Contact

For questions or to report new issues, contact the development team.

**Last Updated:** January 26, 2026
