Skip to content

[quality] Fix mission-control test mocks with missing MissionControlState fields#20563

Merged
kubestellar-hive[bot] merged 2 commits into
mainfrom
quality/test-fix-mission-control-mocks
Jul 8, 2026
Merged

[quality] Fix mission-control test mocks with missing MissionControlState fields#20563
kubestellar-hive[bot] merged 2 commits into
mainfrom
quality/test-fix-mission-control-mocks

Conversation

@clubanderson

Copy link
Copy Markdown
Collaborator

Test Improvement

Fixes the TypeError: Cannot read properties of undefined (reading 'flatMap') in FlightPlanBlueprint and LaunchSequence tests.

Root Cause

The MissionControlState interface was extended with required fields (phase, title, overlay, deployMode, targetClusters, aiStreaming, launchProgress) and ClusterAssignment gained required fields (clusterContext, provider, readiness), but the test mock objects were not updated. The component accesses state.launchProgress.flatMap(...) at line 706, crashing on undefined.

Changes

File Fix
FlightPlanBlueprint.test.tsx Add all required MissionControlState fields + callback props + new launch-progress test
LaunchSequence.test.tsx Add all required MissionControlState and ClusterAssignment fields

Remaining work

Other tests in __tests__/interactive-components.test.tsx and __tests__/mission-control-dialog.test.tsx may need similar updates — they're large files requiring individual analysis.

Partially addresses #20553


Filed by quality agent (ACMM L4/L6 — full mode)

Copilot AI review requested due to automatic review settings July 8, 2026 06:06
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Jul 8, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign eeshaansa for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@netlify

netlify Bot commented Jul 8, 2026

Copy link
Copy Markdown

Deploy Preview for kubestellarconsole ready!

Name Link
🔨 Latest commit b0a976b
🔍 Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/6a4e39a3022ebc00086310c5
😎 Deploy Preview https://deploy-preview-20563.console-deploy-preview.kubestellar.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

🐝 Hi @clubanderson! I'm kubestellar-hive[bot], an automation bot for this repo.

Trusted users — org members and contributors with write access — can mention @kubestellar-hive in a comment to trigger repo automation.
On issues, that mention queues an automated fix attempt. On pull requests, it records extra context for existing automation.
This is not an interactive Q&A bot, so mentions should be treated as requests for automation rather than a conversation.

Automation may take a moment to start, and follow-up happens through workflow activity rather than chat replies.

@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

👋 Hey @clubanderson — thanks for opening this PR!

🤖 This project is developed exclusively using AI coding assistants.

Please do not attempt to code anything for this project manually.
All contributions should be authored using an AI coding tool such as:

This ensures consistency in code style, architecture patterns, test coverage,
and commit quality across the entire codebase.


This is an automated message.

@github-actions github-actions Bot added the ai-generated Pull request generated by AI label Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

✅ Test Coverage Check

All new source files in this PR have corresponding test files.

Checked web/src/hooks/ and web/src/components/ against origin/main.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

♿ Accessibility Audit (WCAG 2.1 AA)

✅ No WCAG 2.1 AA violations detected in audited routes.


Powered by axe-core. Target: WCAG 2.1 AA compliance.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates Mission Control component unit tests to match the newly-required MissionControlState and ClusterAssignment shapes, preventing crashes like TypeError: Cannot read properties of undefined (reading 'flatMap') when components access state.launchProgress.

Changes:

  • Updated MissionControlState test mocks to include new required fields (e.g., phase, title, overlay, deployMode, targetClusters, aiStreaming, launchProgress).
  • Updated ClusterAssignment test mocks to include new required fields (e.g., clusterContext, provider, readiness).
  • Added a FlightPlanBlueprint test case covering a non-empty launchProgress state and wired required callback props.

Reviewed changes

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

File Description
web/src/components/mission-control/LaunchSequence.test.tsx Updates test state mock to include newly-required Mission Control fields (but still needs additional test harness fixes per review comments).
web/src/components/mission-control/FlightPlanBlueprint.test.tsx Updates test state mock and component props; adds coverage for a state with active launchProgress.
Comments suppressed due to low confidence (1)

web/src/components/mission-control/LaunchSequence.test.tsx:63

  • LaunchSequence does not render state.description in the UI (it’s only used when composing the unified mission prompt). This assertion will fail once the render crashes are fixed; assert on a UI element that is actually rendered, such as the launch header title key.
  launchProgress: [],
}

describe('LaunchSequence', () => {
  it('renders mission description', () => {

Comment on lines 22 to 26
const mockState: MissionControlState = {
phase: 'launching',
description: 'Test deployment',
title: 'Test Launch',
projects: [
Comment on lines +55 to +59
overlay: 'architecture',
deployMode: 'phased',
targetClusters: [],
aiStreaming: false,
launchProgress: [],
clubanderson and others added 2 commits July 8, 2026 07:50
…tate fields

The MissionControlState interface was extended with required fields
(phase, title, overlay, deployMode, targetClusters, aiStreaming,
launchProgress) but the test mock was not updated, causing TypeError:
Cannot read properties of undefined (reading 'flatMap') at line 706
where state.launchProgress.flatMap() is called.

Also adds missing onOverlayChange and onDeployModeChange props and
a new test case for active launch progress state.

Partially addresses #20553

Signed-off-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…nControlState fields

Same root cause as FlightPlanBlueprint — the MissionControlState was
extended with required fields but test mocks were not updated. Adds
phase, title, overlay, deployMode, targetClusters, aiStreaming,
launchProgress, and fixes ClusterAssignment to include clusterContext,
provider, and readiness.

Partially addresses #20553

Signed-off-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@kubestellar-hive kubestellar-hive Bot force-pushed the quality/test-fix-mission-control-mocks branch from 2a359a3 to b0a976b Compare July 8, 2026 11:50
@kubestellar-hive kubestellar-hive Bot merged commit c0165b1 into main Jul 8, 2026
42 of 45 checks passed
@kubestellar-prow kubestellar-prow Bot deleted the quality/test-fix-mission-control-mocks branch July 8, 2026 12:28
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

✅ Post-Merge Verification: passed

Commit: c0165b1ef5aec11b35cfeaa32064aa841d96a86c
Specs run: smoke.spec.ts
Report: https://github.com/kubestellar/console/actions/runs/28942540793

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Post-merge build verification passed

Both Go and frontend builds compiled successfully against merge commit c0165b1ef5aec11b35cfeaa32064aa841d96a86c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated Pull request generated by AI dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tier/1-lightweight

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants