Skip to content

Commit

Permalink
fix(demo): react custom demo was not consistent with angular and svelte
Browse files Browse the repository at this point in the history
Changing the value of the second custom pagination example did not
change the value of the first one, unlike the angular and svelte examples.
  • Loading branch information
divdavem committed Aug 24, 2023
1 parent c40a8b7 commit 8bc8c0a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions e2e/pagination/pagination.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,13 @@ test.describe.parallel(`Pagination tests`, () => {
// TODO add test with the custom template, className...
test(`Custom features`, async ({page}) => {
const expectedState = {...initCustomState};
const paginationPO = new PaginationPO(page, 0);
const paginationPO1 = new PaginationPO(page, 0);
const paginationPO2 = new PaginationPO(page, 1);
await page.goto('#/pagination/custom');
await paginationPO.locatorRoot.waitFor();
expect(await paginationState(paginationPO)).toEqual(expectedState);
await paginationPO1.locatorRoot.waitFor();
expect(await paginationState(paginationPO1)).toEqual(expectedState);
await paginationPO2.locatorNextButton.click();
expectedState.pages = ['A', 'B', 'C', 'D', 'E(current)', 'F'];
expect(await paginationState(paginationPO1)).toEqual(expectedState);
});
});
2 changes: 1 addition & 1 deletion react/demo/app/samples/pagination/Custom.route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const PaginationCustom = () => {
/>
<hr />
<p>A pagination with customized pages:</p>
<Pagination page={customPage} slotPages={CustomPages} ariaLabel={'Page navigation with customized pages'} />
<Pagination page={customPage} onPageChange={setPage} slotPages={CustomPages} ariaLabel={'Page navigation with customized pages'} />
</WidgetsDefaultConfig>
</>
);
Expand Down

0 comments on commit 8bc8c0a

Please sign in to comment.