Skip to content

Commit 17a683a

Browse files
author
Tim van Ekert
committed
added some hompage tests
1 parent 34543e0 commit 17a683a

File tree

2 files changed

+3
-30
lines changed

2 files changed

+3
-30
lines changed

lib/public/views/Tags/Overview/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ const ACTIVE_COLUMNS = {
2222
visible: true,
2323
size: 'cell-l',
2424
primary: true,
25+
sortable: true,
2526
},
2627
text: {
2728
name: 'Name',
2829
visible: true,
2930
size: 'cell-l',
31+
sortable: true,
3032
},
3133
};
3234

test/public/logs/overview.test.js

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ module.exports = () => {
4141
});
4242

4343
it('loads the page successfully', async () => {
44-
const response = await page.goto(url, { waitUntil: 'networkidle0' });
44+
const response = await page.goto(`${url}?page=log-overview`, { waitUntil: 'networkidle0' });
4545

4646
// We expect the page to return the correct status code, making sure the server is running properly
4747
expect(response.status()).to.equal(200);
@@ -52,8 +52,6 @@ module.exports = () => {
5252
});
5353

5454
it('can filter by log title', async () => {
55-
goToPage(page, 'log-overview');
56-
await page.waitForTimeout(500);
5755
// Expect the page to have loaded enough rows to be able to test the filtering
5856
const originalRows = await page.$$('table tr');
5957
originalNumberOfRows = originalRows.length - 1;
@@ -96,8 +94,6 @@ module.exports = () => {
9694
});
9795

9896
it('can filter by log author', async () => {
99-
goToPage(page, 'log-overview');
100-
await page.waitForTimeout(500);
10197
// Expect the page to have loaded enough rows to be able to test the filtering
10298
const originalRows = await page.$$('table tr');
10399
originalNumberOfRows = originalRows.length - 1;
@@ -137,8 +133,6 @@ module.exports = () => {
137133

138134
it('can filter by creation date', async () => {
139135
await page.waitForTimeout(200);
140-
goToPage(page, 'log-overview');
141-
await page.waitForTimeout(500);
142136

143137
// Insert a minimum date into the filter
144138
await page.focus('#createdFilterFrom');
@@ -183,8 +177,6 @@ module.exports = () => {
183177

184178
it('can filter by tags', async () => {
185179
await page.waitForTimeout(200);
186-
goToPage(page, 'log-overview');
187-
await page.waitForTimeout(500);
188180

189181
// Select the first available filter and wait for the changes to be processed
190182
const firstCheckboxId = 'tagCheckbox1';
@@ -234,9 +226,6 @@ module.exports = () => {
234226
});
235227

236228
it('can show and hide extra tags if available', async () => {
237-
goToPage(page, 'log-overview');
238-
await page.waitForTimeout(500);
239-
240229
const TAGS_LIMIT = 5;
241230
const buttonId = '#toggleMoreTags';
242231

@@ -265,9 +254,6 @@ module.exports = () => {
265254
});
266255

267256
it('can sort by columns in ascending and descending manners', async () => {
268-
goToPage(page, 'log-overview');
269-
await page.waitForTimeout(500);
270-
271257
// Expect a sorting preview to appear when hovering over a column header
272258
await page.hover('th#title');
273259
await page.waitForTimeout(100);
@@ -325,9 +311,6 @@ module.exports = () => {
325311
});
326312

327313
it('shows correct datatypes in respective columns', async () => {
328-
goToPage(page, 'log-overview');
329-
await page.waitForTimeout(500);
330-
331314
table = await page.$$('tr');
332315
firstRowId = await getFirstRow(table, page);
333316

@@ -363,9 +346,6 @@ module.exports = () => {
363346
});
364347

365348
it('can switch to infinite mode in amountSelector', async () => {
366-
goToPage(page, 'log-overview');
367-
await page.waitForTimeout(500);
368-
369349
const amountSelectorButton = await page.$('#amountSelector button');
370350

371351
// Expect the dropdown options to be visible when it is selected
@@ -391,9 +371,6 @@ module.exports = () => {
391371
});
392372

393373
it('can set how many logs are available per page', async () => {
394-
goToPage(page, 'log-overview');
395-
await page.waitForTimeout(500);
396-
397374
await page.waitForTimeout(500);
398375
// Expect the amount selector to currently be set to Infinite (after the previous test)
399376
const amountSelectorId = '#amountSelector';
@@ -418,9 +395,6 @@ module.exports = () => {
418395
});
419396

420397
it('can switch between pages of logs', async () => {
421-
goToPage(page, 'log-overview');
422-
await page.waitForTimeout(500);
423-
424398
// Expect the page selector to be available with two pages
425399
await page.waitForTimeout(300);
426400
const pageSelectorId = '#amountSelector';
@@ -458,9 +432,6 @@ module.exports = () => {
458432
});
459433

460434
it('dynamically switches between visible pages in the page selector', async () => {
461-
goToPage(page, 'log-overview');
462-
await page.waitForTimeout(500);
463-
464435
// Override the amount of logs visible per page manually
465436
await page.evaluate(() => {
466437
// eslint-disable-next-line no-undef

0 commit comments

Comments
 (0)