Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(quantic): QuanticResultsPerPage fixes and refactor tests #4889

Merged
merged 11 commits into from
Jan 29, 2025

Conversation

erocheleau
Copy link
Collaborator

@erocheleau erocheleau commented Jan 22, 2025

SFINT-5851

IN THIS PR:

  • We are migrating E2E tests for the quanticResultsPerPage component from Cypress to Playwright and adding unit tests.
  • We are also updating the behavior whenever an erroneous initialChoice or no initialChoice is passed to the component. We said

"The initial selection for the number of result per page. This should be part of the choicesDisplayed option. By default, this is set to the first value in choicesDisplayed."

But in reality, we were always defaulting to the value 10 whenever no value was passed,
And if the value was not within the choicesDisplayed we would completely crash Quantic initialization by throwing an error.

Instead now, if the value is invalid (such as not a number, missing or not part of the choicesDisplayed) we actually default to the first value in choicesDisplayed. Log an error in the console, but do not throw.

If the values in choicesDisplayed is invalid, we log an error in the console, and display the componentError, but no longer throw an error.

UNIT TESTS:

image

E2E TESTS:

image

Copy link

github-actions bot commented Jan 22, 2025

Pull Request Report

PR Title

❌ Title should follow the conventional commit spec:
<type>(optional scope): <description>

Example: feat(headless): add result-list controller

Live demo links

Bundle Size

File Old (kb) New (kb) Change (%)
case-assist 243.9 243.9 0
commerce 355.2 355.2 0
search 415.1 415.1 0
insight 406.3 406.3 0
recommendation 256.2 256.2 0
ssr 409 409 0
ssr-commerce 373 373 0

SSR Progress

Use case SSR (#) CSR (#) Progress (%)
search 39 44 89
recommendation 0 4 0
case-assist 0 6 0
insight 0 27 0
commerce 0 15 0
Detailed logs search : buildInteractiveResult
search : buildInteractiveInstantResult
search : buildInteractiveRecentResult
search : buildInteractiveCitation
search : buildGeneratedAnswer
recommendation : missing SSR support
case-assist : missing SSR support
insight : missing SSR support
commerce : missing SSR support

@erocheleau erocheleau marked this pull request as ready for review January 24, 2025 21:45
@erocheleau erocheleau requested a review from a team as a code owner January 24, 2025 21:45
@mmitiche
Copy link
Contributor

@erocheleau to avoid issues with the versioning we should update the PR title to test(quantic): .... or fix(quantic): .... as this PR also fixes the behaviour of the component.

@erocheleau
Copy link
Collaborator Author

@erocheleau to avoid issues with the versioning we should update the PR title to test(quantic): .... or fix(quantic): .... as this PR also fixes the behaviour of the component.

Very true, I forgot! thanks!

@erocheleau erocheleau changed the title feat(SFINT-5851): QuanticResultsPerPage refactor tests feat(quantic): QuanticResultsPerPage refactor tests Jan 28, 2025
@erocheleau erocheleau changed the title feat(quantic): QuanticResultsPerPage refactor tests feat(quantic): QuanticResultsPerPage fixes and refactor tests Jan 28, 2025
Copy link
Contributor

@SimonMilord SimonMilord left a comment

Choose a reason for hiding this comment

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

After addressing mehdi's concerns and comments, it seems good to me!

Copy link
Contributor

@mmitiche mmitiche left a comment

Choose a reason for hiding this comment

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

Looking good, GG!

@erocheleau erocheleau enabled auto-merge January 29, 2025 20:07
@erocheleau erocheleau added this pull request to the merge queue Jan 29, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 29, 2025
@erocheleau erocheleau added this pull request to the merge queue Jan 29, 2025
Merged via the queue into master with commit 0d63ca9 Jan 29, 2025
101 checks passed
@erocheleau erocheleau deleted the SFINT-5851 branch January 29, 2025 21: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.

3 participants