Skip to content

Commit 55b1e3d

Browse files
committed
refactor(ui-pagination): fix failing tests
1 parent 1dbe539 commit 55b1e3d

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

packages/ui-pagination/src/Pagination/__new-tests__/Pagination.test.tsx

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -123,20 +123,17 @@ describe('<Pagination />', () => {
123123
it('by default', async () => {
124124
const { container } = render(
125125
<Pagination variant="compact" labelNext="Next" labelPrev="Prev">
126-
<ul>
127-
{buildPages(5)}
128-
</ul>
126+
{buildPages(5)}
129127
</Pagination>
130128
)
131-
132129
const axeCheck = await runAxeCheck(container)
133130
expect(axeCheck).toBe(true)
134131
})
135132

136133
it('by default with more pages', async () => {
137134
const { container } = render(
138135
<Pagination variant="compact" labelNext="Next" labelPrev="Prev">
139-
<ul>{buildPages(8)}</ul>
136+
{buildPages(8)}
140137
</Pagination>
141138
)
142139
const axeCheck = await runAxeCheck(container)
@@ -153,7 +150,7 @@ describe('<Pagination />', () => {
153150
labelLast="Last"
154151
withFirstAndLastButton
155152
>
156-
<ul>{buildPages(8)}</ul>
153+
{buildPages(8)}
157154
</Pagination>
158155
)
159156
const axeCheck = await runAxeCheck(container)
@@ -171,7 +168,7 @@ describe('<Pagination />', () => {
171168
withFirstAndLastButton
172169
showDisabledButtons
173170
>
174-
<ul>{buildPages(8)}</ul>
171+
{buildPages(8)}
175172
</Pagination>
176173
)
177174
const axeCheck = await runAxeCheck(container)
@@ -966,7 +963,7 @@ describe('<Pagination />', () => {
966963
totalPageNumber={9}
967964
/>
968965
)
969-
expect(container.firstChild).toHaveTextContent('12...9Next Page')
966+
expect(container.firstChild).toHaveTextContent('129Next Page')
970967
})
971968
it('should render the correct pages - 2', () => {
972969
const { container } = render(
@@ -979,7 +976,7 @@ describe('<Pagination />', () => {
979976
/>
980977
)
981978
expect(container.firstChild).toHaveTextContent(
982-
'Previous Page1...456...9Next Page'
979+
'Previous Page14569Next Page'
983980
)
984981
})
985982
it('should render the correct pages - 3', () => {
@@ -1011,7 +1008,7 @@ describe('<Pagination />', () => {
10111008
/>
10121009
)
10131010
expect(container.firstChild).toHaveTextContent(
1014-
'Previous Page12...456...89Next Page'
1011+
'Previous Page1245689Next Page'
10151012
)
10161013
})
10171014
it('should render the correct pages - 5', () => {
@@ -1056,7 +1053,7 @@ describe('<Pagination />', () => {
10561053
siblingCount={1}
10571054
/>
10581055
)
1059-
expect(container.firstChild).toHaveTextContent('123...789Next Page')
1056+
expect(container.firstChild).toHaveTextContent('123789Next Page')
10601057
})
10611058
it('should render the correct ellipsis', () => {
10621059
const { container } = render(
@@ -1098,7 +1095,7 @@ describe('<Pagination />', () => {
10981095
/>
10991096
)
11001097
expect(container.firstChild).toHaveTextContent(
1101-
'Previous Page1...567756785679...1000000000000000Next Page'
1098+
'Previous Page15677567856791000000000000000Next Page'
11021099
)
11031100
})
11041101
it('should render first and last buttons', () => {
@@ -1115,7 +1112,7 @@ describe('<Pagination />', () => {
11151112
/>
11161113
)
11171114
expect(container.firstChild).toHaveTextContent(
1118-
'First PagePrevious Page1...456...100Next PageLast Page'
1115+
'First PagePrevious Page1456100Next PageLast Page'
11191116
)
11201117
})
11211118
it('should render every page if boundary and sibling counts are big enough', () => {

packages/ui-pagination/src/Pagination/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class Pagination extends Component<PaginationProps> {
104104
currentPage: 1,
105105
siblingCount: 1,
106106
boundaryCount: 1,
107-
ellipsis: '...',
107+
ellipsis: '',
108108
renderPageIndicator: (page: number) => page
109109
}
110110

0 commit comments

Comments
 (0)