You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PROMPT currently has no client-side or end-to-end tests. Server services have unit and integration test coverage, but there is no automated validation of user-facing workflows or micro-frontend integration. As the architecture evolves toward separate repositories for core and phases — and external developers build new phases using PROMPT's SDKs — a structured testing methodology is essential to prevent regressions and ensure version compatibility across independently deployed micro-frontends.
Architecture Context
PROMPT's client is built as a micro-frontend architecture using Webpack Module Federation. The core client is the host application that provides shared dependencies (React, React Router, React Query, shared state) and loads phase-specific remote clients at runtime. Each remote client (e.g., assessment, interview, team allocation) exposes three modules (./routes, ./sidebar, ./provide) conforming to shared interfaces defined in the shared library. In the long run, the core client and phase remote clients will live in separate repositories, making cross-client testing essential.
1. Micro-Frontend Testing Methodology
The core challenge is testing Module Federation when the core client and remote clients are developed and deployed independently. PROMPT's federation has a well-defined contract: every remote client exposes three modules (./routes, ./sidebar, ./provide) conforming to shared interfaces (ExtendedRouteObject[], SidebarMenuItemProps, CoursePhaseStudentIdentifierProps). This contract is the foundation of the testing strategy.
1.1 Contract Testing
Each remote client must conform to the core client's expected interface. Contract tests validate this without requiring the full stack to be running:
Export validation: Verify that each remote client's ./routes, ./sidebar, and ./provide exports exist and conform to the expected TypeScript interfaces
Shared dependency compatibility: Verify that each remote client declares compatible versions of singleton dependencies (react, react-dom, react-router-dom, @tanstack/react-query, @tumaet/prompt-shared-state)
Automated contract checks: Run as part of each remote client's CI pipeline so a phase developer gets immediate feedback if their build would break the core client integration
Contract tests should be lightweight and runnable without any server infrastructure
Validate that remote clients load and render correctly within the core client:
Remote loading tests: Verify that remoteEntry.js loads, chunks resolve, and the remote client mounts without errors
Fallback behavior: Verify that when a remote client is unavailable, the core client degrades gracefully (shows LoadingError / DisabledSidebarMenuItem fallbacks instead of crashing)
Routing integration: Verify that the PhaseRouterMapping correctly resolves phase types to remote client components and that subroutes within remote clients work
Sidebar integration: Verify that remote client sidebar items render with correct permissions and navigation
Shared state: Verify that useCourseStore() and useAuthStore() from @tumaet/prompt-shared-state propagate correctly from the core client to remote clients
1.3 Remote Client Isolation Testing
Each remote client should be testable in isolation, independent of the core client:
Provide a test harness that mimics the core client's provider tree (Keycloak context, QueryClient, Router, shared state stores) so remote clients can be mounted and tested standalone
This harness should be part of the shared library or SDK so external phase developers can use it
Each remote client runs its own component and interaction tests against this harness
2. SDK & Shared Library Version Compatibility
As external developers build new phases using PROMPT's SDKs (@tumaet/prompt-shared-state, shared_library, @tumaet/prompt-ui-components), version compatibility becomes critical.
2.1 Compatibility Matrix Testing
Maintain a compatibility matrix that defines which SDK/shared library versions are compatible with which core client version
Run automated tests on CI that verify the current core client against the latest and previous SDK versions
Publish clear version constraints so phase developers know which versions to target
2.2 Breaking Change Detection
Automated checks that detect breaking changes in shared interfaces (ExtendedRouteObject, SidebarMenuItemProps, CoursePhaseStudentIdentifierProps)
When a breaking change is introduced in the shared library, CI should flag it and enforce a major version bump
Consider a reference remote client — a minimal phase implementation that serves as a canary. If the reference remote client breaks, the shared library change is incompatible.
2.3 Phase Developer Testing Toolkit
Provide a CLI or test utility that phase developers can run locally to verify their remote client against the current core client contract
This toolkit should validate: correct exports, interface conformance, shared dependency versions, and basic rendering in the test harness
Publish as part of the SDK documentation
3. End-to-End User Journeys
Full-stack E2E tests using Playwright that validate complete workflows across core client, remote clients, and servers. Organized by user group:
3.1 Administrator Journeys
Login as PROMPT_Admin, navigate management console
Create a new course, configure course phases via the phase graph
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Proposal: PROMPT End-to-End Testing
Motivation
PROMPT currently has no client-side or end-to-end tests. Server services have unit and integration test coverage, but there is no automated validation of user-facing workflows or micro-frontend integration. As the architecture evolves toward separate repositories for core and phases — and external developers build new phases using PROMPT's SDKs — a structured testing methodology is essential to prevent regressions and ensure version compatibility across independently deployed micro-frontends.
Architecture Context
PROMPT's client is built as a micro-frontend architecture using Webpack Module Federation. The core client is the host application that provides shared dependencies (React, React Router, React Query, shared state) and loads phase-specific remote clients at runtime. Each remote client (e.g., assessment, interview, team allocation) exposes three modules (
./routes,./sidebar,./provide) conforming to shared interfaces defined in the shared library. In the long run, the core client and phase remote clients will live in separate repositories, making cross-client testing essential.1. Micro-Frontend Testing Methodology
The core challenge is testing Module Federation when the core client and remote clients are developed and deployed independently. PROMPT's federation has a well-defined contract: every remote client exposes three modules (
./routes,./sidebar,./provide) conforming to shared interfaces (ExtendedRouteObject[],SidebarMenuItemProps,CoursePhaseStudentIdentifierProps). This contract is the foundation of the testing strategy.1.1 Contract Testing
Each remote client must conform to the core client's expected interface. Contract tests validate this without requiring the full stack to be running:
./routes,./sidebar, and./provideexports exist and conform to the expected TypeScript interfacesreact,react-dom,react-router-dom,@tanstack/react-query,@tumaet/prompt-shared-state)1.2 Integration Testing (Core Client + Remote Clients)
Validate that remote clients load and render correctly within the core client:
remoteEntry.jsloads, chunks resolve, and the remote client mounts without errorsLoadingError/DisabledSidebarMenuItemfallbacks instead of crashing)PhaseRouterMappingcorrectly resolves phase types to remote client components and that subroutes within remote clients workuseCourseStore()anduseAuthStore()from@tumaet/prompt-shared-statepropagate correctly from the core client to remote clients1.3 Remote Client Isolation Testing
Each remote client should be testable in isolation, independent of the core client:
2. SDK & Shared Library Version Compatibility
As external developers build new phases using PROMPT's SDKs (
@tumaet/prompt-shared-state,shared_library,@tumaet/prompt-ui-components), version compatibility becomes critical.2.1 Compatibility Matrix Testing
2.2 Breaking Change Detection
ExtendedRouteObject,SidebarMenuItemProps,CoursePhaseStudentIdentifierProps)2.3 Phase Developer Testing Toolkit
3. End-to-End User Journeys
Full-stack E2E tests using Playwright that validate complete workflows across core client, remote clients, and servers. Organized by user group:
3.1 Administrator Journeys
3.2 Instructor Journeys
3.3 Student Journeys
3.4 Cross-Micro-Frontend Journeys
4. Test Environment & Infrastructure
database_dumps/to pre-populate a known state5. CI/CD Integration
detect-changes.ymlto trigger the appropriate test level based on what changed6. Client Unit & Component Testing
As a complementary effort, introduce Vitest for client unit and component testing:
All reactions