Skip to content

Testing/ca diagram#101

Closed
missionStrawberry wants to merge 13 commits into
mainfrom
testing/ca-diagram
Closed

Testing/ca diagram#101
missionStrawberry wants to merge 13 commits into
mainfrom
testing/ca-diagram

Conversation

@missionStrawberry

@missionStrawberry missionStrawberry commented Apr 17, 2026

Copy link
Copy Markdown
Collaborator

Overview

Add test coverage (both end to end and unit) for learning mode and use case interaction diagram pages.

Proposed Changes

  1. Added and refined E2E coverage for use-case interaction diagram flows in use-case-interaction-diagram.spec.ts.
  2. Expanded learning mode E2E behavior checks (including sidebar/content interactions) in learning-mode.spec.ts.
  3. Strengthened CADiagram unit coverage by splitting concerns and consolidating shared setup:
    CADiagram.rendering.test.tsx,
    CADiagram.interactivity.test.tsx,
    CADiagram.status-and-states.test.tsx,
    CADiagram.accessibility-and-resizeobserver.test.tsx,
    testSetup.ts.
  4. Updated related page-level unit tests in:
    LearningMode.test.tsx,
    UseCaseInteractionDiagram.test.tsx.
  5. Minor app wiring updates to support consistency in runtime/test behavior:
    main.tsx,
    index.tsx.

Also moved i18n import to main.

Closes #95
Closes #96

How to Test & Review

cd frontend

  1. Run all unit tests
    npm run test:unit -- --run

  2. Run CADiagram-focused unit tests
    npm run test:unit -- tests/unit/components/CADiagram/CADiagram.rendering.test.tsx tests/unit/components/CADiagram/CADiagram.interactivity.test.tsx tests/unit/components/CADiagram/CADiagram.status-and-states.test.tsx tests/unit/components/CADiagram/CADiagram.accessibility-and-resizeobserver.test.tsx --run

  3. Run all E2E tests
    npm run test:e2e

  4. Run only learning mode E2E
    npm run test:e2e -- tests/e2e/learning-mode.spec.ts --project=chromium

  5. Run only use-case interaction diagram E2E
    npm run test:e2e -- tests/e2e/use-case-interaction-diagram.spec.ts --project=chromium

  6. Open Playwright UI mode
    npm run test:e2e -- --ui

Type of Change

(Write an X or a brief description next to the type or types that best describe your changes.)

Type Applies?
🚨 Breaking change (fix or feature that would cause existing functionality to change)
New feature (non-breaking change that adds functionality)
🐛 Bug fix (non-breaking change that fixes an issue)
🎨 User interface change (change to user interface; provide screenshots)
♻️ Refactoring (internal change to codebase, without changing functionality)
🚦 Test update (change that only adds or modifies tests) X
📚 Documentation update (change that only updates documentation)
📦 Dependency update (change that updates a dependency)
🔧 Internal (change that only affects developers or continuous integration)

Checklist

(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the [ ] into a [x] in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)

Before opening your pull request:

  • I have performed a self-review of my changes.

    • Check that all changed files included in this pull request are intentional changes.
    • Check that all changes are relevant to the purpose of this pull request, as described above.
  • I have added tests for my changes, if applicable.

    • This is required for all bug fixes and new features.
  • I have updated the project documentation, if applicable.

    • This is required for new features.
  • (Frontend) I have added/updated text in i18n JSON files for any new user-facing strings to support multilingual features.
    After opening your pull request:

  • I have verified that the CI tests have passed.

  • I have requested a review from a project maintainer, and a fellow student.

  • Technical Debt: If temporary workarounds or "TODOs" were used, I have opened a tracking issue to address them properly.

    • Linked Issues:

Questions and Comments

Copilot AI review requested due to automatic review settings April 17, 2026 18:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds unit tests covering the LearningMode page UI behavior (header presence and sidebar interactions) while mocking heavy diagram components.

Changes:

  • Introduces LearningMode page unit tests validating initial render state.
  • Tests sidebar behavior for open/close and node-click-driven content updates.
  • Mocks CADiagram (and attempts to mock Legend) to keep tests focused and fast.

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

Comment thread clean-architecture-visualizer/frontend/tests/unit/pages/LearningMode.test.tsx Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.


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

Comment thread clean-architecture-visualizer/frontend/src/main.tsx
Comment thread clean-architecture-visualizer/frontend/tests/e2e/learning-mode.spec.ts Outdated

@vivjd vivjd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks great! And thank you for adding the i18n config to main.tsx

@matt-dahlgren matt-dahlgren deleted the testing/ca-diagram branch June 10, 2026 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add tests for use case interaction diagram page Learning mode tests

4 participants