Skip to content

Add feedback tab user journey#267

Merged
apinkert merged 2 commits intoRedHatInsights:masterfrom
apinkert:feedback-journey
Mar 16, 2026
Merged

Add feedback tab user journey#267
apinkert merged 2 commits intoRedHatInsights:masterfrom
apinkert:feedback-journey

Conversation

@apinkert
Copy link
Collaborator

For RHCLOUD-45772

Screen.Recording.2026-03-16.at.10.19.59.AM.mov

@coderabbitai
Copy link

coderabbitai bot commented Mar 16, 2026

Summary by CodeRabbit

  • Tests
    • Added a Storybook user-journey test suite for the Help Panel Feedback Panel covering page loads, navigating to the Feedback tab, feedback submission, bug reporting, research opportunities, breadcrumb navigation, and email display toggle, plus a manual testing entry point and step-by-step automated interactions.

Walkthrough

Adds a new Storybook user-journey test suite that defines a default meta and eight stories to automate seven feedback-related workflows plus a manual testing entry point for the Help Panel Feedback Panel.

Changes

Cohort / File(s) Summary
Help Panel Feedback Panel Stories
src/user-journeys/HelpPanelFeedbackPanel.stories.tsx
New Storybook user-journey file exporting meta and eight stories: ManualTesting, Step01_PageLoads, Step02_NavigateToFeedbackTab, Step03_ShareFeedbackWorkflow, Step04_ReportBugWorkflow, Step05_ResearchOpportunitiesWorkflow, Step06_BreadcrumbNavigation, Step07_EmailDisplayToggle. Each story includes play functions that navigate the UI, interact with cards/forms, toggle checkboxes, verify email panel display, use MSW handlers, and drive automated UI assertions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add feedback tab user journey' is clear and directly related to the changeset, which adds a new Storybook user-journey test suite for the Help Panel Feedback Panel.
Description check ✅ Passed The description references Jira ticket RHCLOUD-45772 and includes a linked asset, demonstrating connection to the work despite minimal detail provided.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can use Trivy to scan for security misconfigurations and secrets in Infrastructure as Code files.

Add a .trivyignore file to your project to customize which findings Trivy reports.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/user-journeys/HelpPanelFeedbackPanel.stories.tsx (1)

149-150: Replace global DOM selectors with canvas-scoped semantic queries.

Using document.getElementById/querySelector in Storybook play functions is less idiomatic and brittle. The file already imports within and uses canvas.findByRole and canvas.getByText elsewhere—apply this pattern consistently by using canvas.findByRole, canvas.findByLabelText, canvas.findByText, or stable data-testid attributes throughout.

Applies to: lines 149, 156, 165, 173, 203, 210, 219, 227, 271, 278, 288, 299, 331, 340, 378, 382, 390, 405

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/user-journeys/HelpPanelFeedbackPanel.stories.tsx` around lines 149 - 150,
Replace global DOM selectors (e.g., the getElementById call that targets
'feedback-description-text' and other
document.querySelector/document.getElementById usages) with canvas-scoped
semantic queries used elsewhere in this file: use canvas.findByLabelText,
canvas.findByRole, canvas.findByText or canvas.findByTestId (or
within(canvas).getBy*) to locate elements inside the story canvas; update every
instance listed (including the 'feedback-description-text' lookup and the other
occurrences on the lines noted) to use those canvas-scoped queries so tests are
stable and consistent with the existing canvas.findByRole/canvas.getByText
pattern.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/user-journeys/HelpPanelFeedbackPanel.stories.tsx`:
- Line 396: Update the misleading console.log in the HelpPanelFeedbackPanel
story: replace the message "UJ: ✅ Email display before checkbox checked" (the
console.log call that runs during the Step07 state transition) with a message
that correctly reflects it executes after the checkbox is checked, e.g. "UJ: ✅
Email display after checkbox checked" so the log matches the actual state and
flow.
- Around line 340-356: The test currently guards breadcrumbLink with an if,
allowing the step to silently skip when the element is missing; instead, assert
its presence and fail fast: replace the conditional guard around the
document.querySelector('.feedback-breadcrumb-link') (breadcrumbLink) with an
explicit presence check (e.g., expect(breadcrumbLink).toBeTruthy() or throw if
null) before calling userEvent.click and delay, keeping the rest of the flow
(userEvent.click, delay(TEST_TIMEOUTS.AFTER_CLICK), waitFor and
canvas.getByText(/Tell us about your experience/i)) unchanged so the test fails
when the breadcrumb is not found.

---

Nitpick comments:
In `@src/user-journeys/HelpPanelFeedbackPanel.stories.tsx`:
- Around line 149-150: Replace global DOM selectors (e.g., the getElementById
call that targets 'feedback-description-text' and other
document.querySelector/document.getElementById usages) with canvas-scoped
semantic queries used elsewhere in this file: use canvas.findByLabelText,
canvas.findByRole, canvas.findByText or canvas.findByTestId (or
within(canvas).getBy*) to locate elements inside the story canvas; update every
instance listed (including the 'feedback-description-text' lookup and the other
occurrences on the lines noted) to use those canvas-scoped queries so tests are
stable and consistent with the existing canvas.findByRole/canvas.getByText
pattern.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4443477b-569a-4ed0-abb4-43188d9065ad

📥 Commits

Reviewing files that changed from the base of the PR and between a8677e8 and b6362d7.

📒 Files selected for processing (1)
  • src/user-journeys/HelpPanelFeedbackPanel.stories.tsx

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (2)
src/user-journeys/HelpPanelFeedbackPanel.stories.tsx (2)

381-381: ⚠️ Potential issue | 🟡 Minor

Correct the Step07 log message to match actual state.

This log runs after the checkbox is checked, so the message is currently misleading.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/user-journeys/HelpPanelFeedbackPanel.stories.tsx` at line 381, The Step07
console log in HelpPanelFeedbackPanel.stories.tsx is misleading because it says
"Email display before checkbox checked" but executes after the checkbox is
checked; update the console.log in the Step07 handler (the log near the checkbox
interaction in the HelpPanelFeedbackPanel story) to reflect the actual state
(e.g., "UJ: ✅ Email display after checkbox checked" or equivalent) so the
message matches the action performed.

325-341: ⚠️ Potential issue | 🟠 Major

Fail fast when breadcrumb link is missing.

The if (breadcrumbLink) guard allows this journey to pass even if breadcrumb navigation is broken. Make breadcrumb presence mandatory before clicking.

Suggested fix
     // Click the breadcrumb to go back to home
     const breadcrumbLink = document.querySelector('.feedback-breadcrumb-link');
-
-    if (breadcrumbLink) {
-      await userEvent.click(breadcrumbLink as HTMLElement);
-      await delay(TEST_TIMEOUTS.AFTER_CLICK);
-
-      // Verify we're back at home
-      await waitFor(
-        () => {
-          const title = canvas.getByText(/Tell us about your experience/i);
-          expect(title).toBeInTheDocument();
-        },
-        { timeout: 5000 }
-      );
-
-      console.log('UJ: ✅ Breadcrumb navigation back to feedback home');
-    }
+    expect(breadcrumbLink).toBeInTheDocument();
+    await userEvent.click(breadcrumbLink as HTMLElement);
+    await delay(TEST_TIMEOUTS.AFTER_CLICK);
+
+    // Verify we're back at home
+    await waitFor(
+      () => {
+        const title = canvas.getByText(/Tell us about your experience/i);
+        expect(title).toBeInTheDocument();
+      },
+      { timeout: 5000 }
+    );
+
+    console.log('UJ: ✅ Breadcrumb navigation back to feedback home');
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/user-journeys/HelpPanelFeedbackPanel.stories.tsx` around lines 325 - 341,
The test currently skips breadcrumb verification when
document.querySelector('.feedback-breadcrumb-link') returns null; make the
breadcrumb presence mandatory by replacing the optional guard with an explicit
assertion (e.g., expect(breadcrumbLink).toBeTruthy() or throw an Error)
immediately after querying it, so that if breadcrumbLink is null the test fails
fast before calling userEvent.click; update the block around breadcrumbLink,
userEvent.click(breadcrumbLink as HTMLElement), delay(TEST_TIMEOUTS.AFTER_CLICK)
and the following waitFor to rely on that assertion.
🧹 Nitpick comments (1)
src/user-journeys/HelpPanelFeedbackPanel.stories.tsx (1)

93-94: Prefer shared timeout constant over repeated 5000 literals.

Using TEST_TIMEOUTS.ELEMENT_WAIT here improves consistency and centralizes tuning.

Also applies to: 137-138, 191-192, 229-230, 259-260, 287-288, 321-322, 337-338, 378-379, 393-394

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/user-journeys/HelpPanelFeedbackPanel.stories.tsx` around lines 93 - 94,
Replace all hard-coded 5000 timeout literals in
HelpPanelFeedbackPanel.stories.tsx with the shared constant
TEST_TIMEOUTS.ELEMENT_WAIT; update each waitFor/wait/expect call (the sites
noted around the occurrences) to use TEST_TIMEOUTS.ELEMENT_WAIT, and add the
necessary import for TEST_TIMEOUTS at the top of the file if missing so the file
compiles and all referenced places (the clusters near lines 93-94, 137-138,
191-192, 229-230, 259-260, 287-288, 321-322, 337-338, 378-379, 393-394)
consistently use the centralized timeout constant.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@src/user-journeys/HelpPanelFeedbackPanel.stories.tsx`:
- Line 381: The Step07 console log in HelpPanelFeedbackPanel.stories.tsx is
misleading because it says "Email display before checkbox checked" but executes
after the checkbox is checked; update the console.log in the Step07 handler (the
log near the checkbox interaction in the HelpPanelFeedbackPanel story) to
reflect the actual state (e.g., "UJ: ✅ Email display after checkbox checked" or
equivalent) so the message matches the action performed.
- Around line 325-341: The test currently skips breadcrumb verification when
document.querySelector('.feedback-breadcrumb-link') returns null; make the
breadcrumb presence mandatory by replacing the optional guard with an explicit
assertion (e.g., expect(breadcrumbLink).toBeTruthy() or throw an Error)
immediately after querying it, so that if breadcrumbLink is null the test fails
fast before calling userEvent.click; update the block around breadcrumbLink,
userEvent.click(breadcrumbLink as HTMLElement), delay(TEST_TIMEOUTS.AFTER_CLICK)
and the following waitFor to rely on that assertion.

---

Nitpick comments:
In `@src/user-journeys/HelpPanelFeedbackPanel.stories.tsx`:
- Around line 93-94: Replace all hard-coded 5000 timeout literals in
HelpPanelFeedbackPanel.stories.tsx with the shared constant
TEST_TIMEOUTS.ELEMENT_WAIT; update each waitFor/wait/expect call (the sites
noted around the occurrences) to use TEST_TIMEOUTS.ELEMENT_WAIT, and add the
necessary import for TEST_TIMEOUTS at the top of the file if missing so the file
compiles and all referenced places (the clusters near lines 93-94, 137-138,
191-192, 229-230, 259-260, 287-288, 321-322, 337-338, 378-379, 393-394)
consistently use the centralized timeout constant.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dff20ce4-a2e7-45d3-9b18-301be5773e7c

📥 Commits

Reviewing files that changed from the base of the PR and between a8677e8 and d64a465.

📒 Files selected for processing (1)
  • src/user-journeys/HelpPanelFeedbackPanel.stories.tsx

@apinkert apinkert merged commit c65b0ac into RedHatInsights:master Mar 16, 2026
10 checks passed
@apinkert apinkert deleted the feedback-journey branch March 16, 2026 18:48
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.

2 participants