Skip to content

ENT-11639: Add testimonials to all plans - updated AcademicSelection …#160

Closed
gshivajibiradar wants to merge 0 commit intomainfrom
feature/ENT-11639-testimonials-all-plans
Closed

ENT-11639: Add testimonials to all plans - updated AcademicSelection …#160
gshivajibiradar wants to merge 0 commit intomainfrom
feature/ENT-11639-testimonials-all-plans

Conversation

@gshivajibiradar
Copy link
Copy Markdown
Contributor

Summary
This PR implements ENT-11639 by adding the testimonials component across all plans in the checkout flow.

Changes
Updated AcademicSelection component
Integrated testimonials section for all plans
Ensured consistent UI across Essentials and other plan flows
Improved layout and user experience

Dependency
Dependent on ENT-11423 (plan details implementation)

Testing
Verified testimonials display correctly across all plans
Checked UI responsiveness and alignment
Ensured no impact on existing checkout flow

Next Steps
Ready for review once dependent ticket is merged
Will proceed with final validation after integration

Copilot AI review requested due to automatic review settings March 24, 2026 07:50
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.23%. Comparing base (5acd6ec) to head (61084c9).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #160      +/-   ##
==========================================
+ Coverage   86.99%   87.23%   +0.24%     
==========================================
  Files         153      153              
  Lines        2799     2868      +69     
  Branches      526      559      +33     
==========================================
+ Hits         2435     2502      +67     
- Misses        364      366       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
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

Implements ENT-11639 by extending the Essentials “AcademicSelection” page layout to include the shared purchase summary area (which contains the testimonial card), aligning the Essentials flow UI with the main checkout layout.

Changes:

  • Updated AcademicSelection to a two-column Row/Col layout.
  • Added PurchaseSummary to the right column so testimonials/purchase summary appear in the Essentials flow.
  • Adjusted container padding to match other checkout pages (py-4.5).

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

Comment thread src/components/essentials-page/AcademicSelection.tsx Outdated
Copilot AI review requested due to automatic review settings March 24, 2026 08:07
Copy link
Copy Markdown
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

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


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

Comment thread src/components/essentials-page/tests/AcademicSelection.test.tsx Outdated
Comment thread src/components/essentials-page/tests/AcademicSelection.test.tsx Outdated
Comment thread src/components/essentials-page/tests/AcademicSelection.test.tsx Outdated
Comment thread src/components/essentials-page/tests/AcademicSelection.test.tsx Outdated
Copy link
Copy Markdown
Collaborator

@brobro10000 brobro10000 left a comment

Choose a reason for hiding this comment

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

Please reference the figma design for implementation. Approving to unblock

Comment thread src/components/essentials-page/AcademicSelection.tsx Outdated
Copilot AI review requested due to automatic review settings April 22, 2026 03:15
@gshivajibiradar gshivajibiradar force-pushed the feature/ENT-11639-testimonials-all-plans branch from 61084c9 to 0c108ae Compare April 22, 2026 03:15
Copy link
Copy Markdown
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

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

Comments suppressed due to low confidence (1)

src/components/app/data/hooks/useTestimonials.tsx:49

  • fetchTestimonials changes behavior based on whether getAuthenticatedUser() returns a session, but the React Query queryKey is always ['testimonials'] and staleTime is Infinity. If the query runs while unauthenticated (returning fallbacks) and the user later authenticates during the flow, the cached fallback data will never be refetched. Consider including an auth discriminator (e.g., user ID / boolean) in the queryKey and/or allowing refetch on auth changes instead of using staleTime: Infinity unconditionally.
export const fetchTestimonials = async (): Promise<Testimonial[]> => {
  const { ENTERPRISE_ACCESS_BASE_URL } = getConfig();
  const url = `${ENTERPRISE_ACCESS_BASE_URL}/api/v1/testimonials/`;
  try {
    // Use authenticated client when a JWT is available (account-details, billing-details)
    // Fall back to plain axios for unauthenticated steps (plan-details/register, plan-details/login)
    const user = getAuthenticatedUser();
    const res = user
      ? await getAuthenticatedHttpClient().get(url)
      : await axios.get(url);
    return res.data?.results?.length ? res.data.results : DEFAULT_TESTIMONIALS;
  } catch {
    return DEFAULT_TESTIMONIALS;
  }
};

const useTestimonials = () => useQuery({
  queryKey: ['testimonials'],
  queryFn: fetchTestimonials,
  staleTime: Infinity,
});

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

Comment on lines +15 to +16
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function planDetailsLoader(_queryClient: QueryClient, _routeContext: RouteContext): Promise<Response | null> {
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

planDetailsLoader now requires a RouteContext parameter, but RouteContext is not imported/defined in this file and the extra required parameter makes the function incompatible with how PAGE_LOADERS is typed/called (it is invoked with only queryClient). Consider reverting this loader to a single-argument signature (e.g., (queryClient: QueryClient)) and remove the unused RouteContext parameter (or make it optional and correctly imported if you truly need it).

Suggested change
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function planDetailsLoader(_queryClient: QueryClient, _routeContext: RouteContext): Promise<Response | null> {
async function planDetailsLoader(_queryClient: QueryClient): Promise<Response | null> {

Copilot uses AI. Check for mistakes.
Comment on lines 26 to 27
async function planDetailsLoginLoader(_queryClient: QueryClient, routeContext: RouteContext): Promise<Response | null> {
const authenticatedUser = getAuthenticatedUser();
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

planDetailsLoginLoader declares a routeContext: RouteContext argument that is unused, and RouteContext is not imported/defined in this module. This will fail type-checking/linting. If the context isn’t needed here, drop the parameter entirely (or prefix with _ and import the type if it is needed).

Copilot uses AI. Check for mistakes.
Comment on lines +151 to +165
it('does not repeat a testimonial until all have been shown', async () => {
const testimonials = [
{ uuid: '1', quote_text: 'First', attribution_name: 'A', attribution_title: 'T1' },
{ uuid: '2', quote_text: 'Second', attribution_name: 'B', attribution_title: 'T2' },
];
(useTestimonials as jest.Mock).mockReturnValue({ data: testimonials, isLoading: false });

// Render at plan-details step; a testimonial should be shown
renderWithProviders(`/${CheckoutStepKey.PlanDetails}`);
await waitFor(() => expect(screen.getByTestId('testimonial-card')).toBeInTheDocument());

const firstQuote = screen.getByTestId('testimonial-quote').textContent;
// First quote must be one of the two testimonials
expect(['First', 'Second']).toContain(firstQuote);
});
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

This test name claims to verify the “no repeat until all have been shown” behavior, but the assertions only check that the first rendered quote is one of the provided testimonials. Either extend the test to navigate/rerender across multiple steps (or rerun the selection logic) and assert no duplicates until the list is exhausted, or rename the test to match what it actually verifies.

Copilot uses AI. Check for mistakes.
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.

4 participants