Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

bugfix(KLEF): Fix Tests#122

Merged
isaacwallace123 merged 1 commit intomainfrom
bugfix/KLEF_Fix_Localisation_Dashboard
Mar 5, 2026
Merged

bugfix(KLEF): Fix Tests#122
isaacwallace123 merged 1 commit intomainfrom
bugfix/KLEF_Fix_Localisation_Dashboard

Conversation

@NathanRoos
Copy link
Contributor

🚀 Pull Request Overview

📌 Summary

🔗 Related Issues

Closes #


🧪 Changes

✅ What’s Included

❌ What’s Not Included


🧪 Testing

🔍 How Was This Tested?

🧪 Test Coverage

  • Unit tests added/updated
  • Integration tests added/updated
  • End-to-end scenarios tested manually

🧩 Breaking Changes

Does this PR introduce breaking changes?

  • Yes
  • No

If yes, describe the impact and migration steps:


🔐 Security Considerations

  • This PR affects authentication or authorization
  • This PR touches secrets, tokens, or environment variables
  • This PR affects infrastructure or deployment pipeline

If checked, explain:


📝 Documentation

Does this PR require updates to documentation?

  • Yes
  • No

If yes, update the relevant locations:

  • /docs
  • README.md
  • API reference
  • Architecture diagrams / C4 / DDD docs

🎨 UI/UX Considerations (If Applicable)

  • Includes new components
  • Changes styles or theme tokens
  • Requires design approval
  • Responsive behavior tested

Screenshots / recordings (if applicable):


📦 Checklist Before Merge

  • Follows project coding style
  • PR title follows semantic format (feat:, fix:, chore:, docs:, refactor:, test:)
  • All CI checks passing
  • No debug logs or commented-out code
  • Dependencies reviewed
  • No sensitive information added

👤 Contributor Notes (Optional)

Copilot AI review requested due to automatic review settings March 5, 2026 00:27
@NathanRoos NathanRoos self-assigned this Mar 5, 2026
@github-actions github-actions bot added the bugfix Bug fix label Mar 5, 2026
@isaacwallace123 isaacwallace123 merged commit e747ad1 into main Mar 5, 2026
15 of 16 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new Playwright E2E test case to container-logs.spec.ts that verifies the error UI is displayed when the observability service returns a 500 error. It also fixes the closing brace that was missing from the preceding "can filter logs" test, which would have caused the suite to be malformed.

Changes:

  • Adds the }); closing brace that was missing from the "can filter logs" test
  • Adds a new E2E test "displays error card when observability service is unreachable" that intercepts the logs API with a mocked 500 response and asserts the error card UI (network issue message and "Try Again" button) is visible

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +300 to +304
// Wait for fetch to complete
await page.waitForTimeout(2000);

// Assert error card is visible
await expect(page.getByText(/network issue/i)).toBeVisible();
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The page.waitForTimeout(2000) on line 301 is a fixed-duration sleep used to wait for the mocked 500 response to propagate and the error UI to render. This is a flaky testing pattern — if the network or UI is slower than 2 seconds, the subsequent assertions will fail, and if it's much faster, the wait is wasteful.

A more deterministic approach is to use page.waitForResponse to wait for the intercepted request to be fulfilled before asserting on the UI. For example, you could capture the response promise before clicking "View Logs" and await it before proceeding to assertions. Alternatively, since the error UI is ultimately what you're checking, await expect(page.getByText(/network issue/i)).toBeVisible({ timeout: 10_000 }) without the fixed sleep is more reliable. The existing test on line 137 uses the same pattern and has the same concern.

Suggested change
// Wait for fetch to complete
await page.waitForTimeout(2000);
// Assert error card is visible
await expect(page.getByText(/network issue/i)).toBeVisible();
// Assert error card is visible (Playwright will auto-wait for this state)
await expect(page.getByText(/network issue/i)).toBeVisible({ timeout: 10_000 });

Copilot uses AI. Check for mistakes.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bugfix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants