Skip to content

Commit 910fa29

Browse files
committed
update test descriptions
1 parent 8a4b900 commit 910fa29

1 file changed

Lines changed: 7 additions & 13 deletions

File tree

client/modules/IDE/components/AddToCollectionSketchList.unit.test.jsx

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ describe('<AddToCollectionSketchList />', () => {
113113
}
114114
});
115115

116-
it('clicking "Next Page" requests page 2 and updates list', async () => {
116+
it('clicking next requests second page and updates sketch list', async () => {
117117
subject();
118118
await screen.findByText('page1-sketch-1');
119119

@@ -129,7 +129,7 @@ describe('<AddToCollectionSketchList />', () => {
129129
await screen.findByText('page2-sketch-1');
130130
});
131131

132-
it('Previous Page is disabled on page 1', async () => {
132+
it('clicking previous is not available on the first page', async () => {
133133
subject();
134134
await screen.findByText('page1-sketch-1');
135135

@@ -138,7 +138,7 @@ describe('<AddToCollectionSketchList />', () => {
138138
).toBeDisabled();
139139
});
140140

141-
it('shows empty state when server returns no projects', async () => {
141+
it('shows empty state if there are no projects', async () => {
142142
server.use(
143143
rest.get('/projects', (req, res, ctx) => {
144144
requestCount += 1;
@@ -211,7 +211,7 @@ describe('<AddToCollectionSketchList />', () => {
211211
});
212212
});
213213

214-
it('renders correct pagination text when totalProjects is not a multiple of 10', async () => {
214+
it('renders correct pagination numbers when totalProjects is not a multiple of 10', async () => {
215215
server.use(
216216
rest.get('/projects', (req, res, ctx) => {
217217
const page = Number(req.url.searchParams.get('page') ?? 1);
@@ -251,24 +251,18 @@ describe('<AddToCollectionSketchList />', () => {
251251
await screen.findByText('page1-sketch-1');
252252

253253
let info = document.querySelector('.pagination-info');
254-
expect(info.textContent.replace(/\s+/g, ' ').trim()).toContain(
255-
'1 - 10 of 23'
256-
);
254+
expect(info.textContent.replace(/\s+/g, ' ').trim()).toContain('1 - 10');
257255

258256
fireEvent.click(screen.getByRole('button', { name: 'Next Page' }));
259257
await screen.findByText('page2-sketch-1');
260258

261259
info = document.querySelector('.pagination-info');
262-
expect(info.textContent.replace(/\s+/g, ' ').trim()).toContain(
263-
'11 - 20 of 23'
264-
);
260+
expect(info.textContent.replace(/\s+/g, ' ').trim()).toContain('11 - 20');
265261

266262
fireEvent.click(screen.getByRole('button', { name: 'Next Page' }));
267263
await screen.findByText('page3-sketch-1');
268264

269265
info = document.querySelector('.pagination-info');
270-
expect(info.textContent.replace(/\s+/g, ' ').trim()).toContain(
271-
'21 - 23 of 23'
272-
);
266+
expect(info.textContent.replace(/\s+/g, ' ').trim()).toContain('21 - 23');
273267
});
274268
});

0 commit comments

Comments
 (0)