-
Notifications
You must be signed in to change notification settings - Fork 35
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(atomic-commerce): products-per-page #4107
base: master
Are you sure you want to change the base?
Conversation
Pull Request ReportPR Title✅ Title follows the conventional commit spec. Live demo linksBundle Size
SSR Progress
Detailed logssearch : buildInteractiveResultsearch : buildInteractiveInstantResult search : buildInteractiveRecentResult search : buildInteractiveCitation search : buildGeneratedAnswer recommendation : missing SSR support product-recommendation : missing SSR support product-listing : missing SSR support case-assist : missing SSR support insight : missing SSR support commerce : missing SSR support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something is wrong with the URL management.
Whenever the search page loads with the #perPage=
attribute in the URL, 2 search queries are triggered.
The second being the value in the perPage
value from the URL
However, when first loading a listing page, the perPage value does not have any effect on the component.
also Jira number? |
}); | ||
|
||
test('should render the component with the right choice selected', async ({ | ||
productsPerPage, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should update the tests to also execute the assertions on a listing page
await expect(productsPerPage.label().first()).toBeVisible(); | ||
await expect(productsPerPage.choice(25)).toBeChecked(); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a test to ensure only a search query is fired
styleUrl: 'atomic-commerce-products-per-page.pcss', | ||
shadow: true, | ||
}) | ||
export class AtomicResultsPerPage implements InitializableComponent<Bindings> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's too much copy paste between this and atomic-results-per-page
.
The most important thing will be to extract functional components for everything visual (ie: all renderXYZ()
function) at the very least. This is mandatory to make sure parts, styling (css classes), i18n strings, and how things behave for end users stays consistent.
Then there's some other utility type function (ie: the validateXYZ()
functions, or code that control end user focus for accessibility) can be shared exactly one to one, and so we should aim to refactor and extract those.
In general however, those utility function are "less important" to refactor, if compared to the rendering code itself.
PageGuard
to be "generic" (result->page)PageGuard
foratomic-per-page