Skip to content

Commit 90c1466

Browse files
committed
III-6978: test empty values based on label instead of on numbers
1 parent 74876b0 commit 90c1466

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

src/test/e2e/events/create-calendar-multiple.spec.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ test('create an event with calendarType multiple', async ({
7777
const expectedLabels = [
7878
'Titel',
7979
'Type',
80+
'Thema',
8081
'Labels',
8182
'Beschrijving',
8283
'Waar',
@@ -103,18 +104,27 @@ test('create an event with calendarType multiple', async ({
103104
// Validate that some rows have "Geen" when empty
104105
const tableRows = await page.locator('table.table > tbody > tr').count();
105106

106-
const rowsWithGeenValue = [2, 4, 7, 8, 11, 12, 14, 15];
107-
108-
const secondColumnCells = await page
109-
.locator('table.table > tbody > tr > td:nth-child(2)')
110-
.allTextContents();
107+
const expectedEmptyFields = [
108+
'Thema',
109+
'Beschrijving',
110+
'Organisatie',
111+
'Prijsinfo',
112+
'Reservatie',
113+
'Contactgegevens',
114+
'Afbeeldingen',
115+
"Video's",
116+
];
111117

112118
for (let i = 0; i < tableRows; i++) {
119+
const firstColumnValue = await page
120+
.locator(`table.table > tbody > tr:nth-child(${i + 1}) > td:nth-child(1)`)
121+
.textContent();
122+
113123
const secondColumnValue = await page
114124
.locator(`table.table > tbody > tr:nth-child(${i + 1}) > td:nth-child(2)`)
115125
.textContent();
116126

117-
if (rowsWithGeenValue.includes(i)) {
127+
if (expectedEmptyFields.includes(firstColumnValue?.trim() ?? '')) {
118128
expect(secondColumnValue).toContain('Geen');
119129
} else {
120130
expect(secondColumnValue?.trim()).not.toBe('');

0 commit comments

Comments
 (0)