Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
martinboulais committed Dec 20, 2024
1 parent ab57c4b commit 33c3c0f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/public/logs/create.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ module.exports = () => {
});

it('Should successfully display the log-reply form', async () => {
await goToPage(page, 'log-reply&parentLogId=1');
await goToPage(page, 'log-reply', { queryParameters: { parentLogId: '1' } });

await expectInnerText(page, 'h3', 'Reply to: First entry');

Expand All @@ -122,63 +122,63 @@ module.exports = () => {
});

it('Should successfully display the autofilled runs, environments and lhcFills when replying', async () => {
await goToPage(page, 'log-reply&parentLogId=119');
await goToPage(page, 'log-reply', { queryParameters: { parentLogId: '119' } });

await expectInputValue(page, 'input#run-numbers', '2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22');
await expectInputValue(page, 'input#environments', 'Dxi029djX, eZF99lH6');
await expectInputValue(page, 'input#lhc-fills', '1, 4, 6');
});

it('Should verify that form autofill all inputs with provided full parameters.', async () => {
await goToPage(page, 'log-create&runNumbers=1,2,3&lhcFillNumbers=1,2,3&environmentIds=1,2,3');
await goToPage(page, 'log-create', { queryParameters: { runNumbers: '1,2,3', lhcFillNumbers: '1,2,3', environmentIds: '1,2,3' } });

await expectInputValue(page, 'input#run-numbers', '1,2,3');
await expectInputValue(page, 'input#environments', '1,2,3');
await expectInputValue(page, 'input#lhc-fills', '1,2,3');
});

it('Should verify that form autofill runNumbers only when leaving other parameters empty.', async () => {
await goToPage(page, 'log-create&runNumbers=1,2,3');
await goToPage(page, 'log-create', { queryParameters: { runNumbers: '1,2,3' } });

await expectInputValue(page, 'input#run-numbers', '1,2,3');
await expectInputValue(page, 'input#environments', '');
await expectInputValue(page, 'input#lhc-fills', '');
});

it('Should verify that form autofill environmentIds only when leaving other parameters empty.', async () => {
await goToPage(page, 'log-create&environmentIds=1,2,3');
await goToPage(page, 'log-create', { queryParameters: { environmentIds: '1,2,3' } });

await expectInputValue(page, 'input#run-numbers', '');
await expectInputValue(page, 'input#environments', '1,2,3');
await expectInputValue(page, 'input#lhc-fills', '');
});

it('Should verify that form autofill the lhcFillNumbers only when leaving other parameters empty.', async () => {
await goToPage(page, 'log-create&lhcFillNumbers=1,2,3');
await goToPage(page, 'log-create', { queryParameters: { lhcFillNumbers: '1,2,3' } });

await expectInputValue(page, 'input#run-numbers', '');
await expectInputValue(page, 'input#environments', '');
await expectInputValue(page, 'input#lhc-fills', '1,2,3');
});

it('Should verify that form autofill the runNumbers and environmentIds when leaving lhcFills empty.', async () => {
await goToPage(page, 'log-create&runNumbers=1,2,3&environmentIds=1,2,3');
await goToPage(page, 'log-create', { queryParameters: { runNumbers: '1,2,3', environmentIds: '1,2,3' } });

await expectInputValue(page, 'input#run-numbers', '1,2,3');
await expectInputValue(page, 'input#environments', '1,2,3');
await expectInputValue(page, 'input#lhc-fills', '');
});

it('Should verify that form autofill the runNumbers and lhcFillNumbers when leaving environmentIds empty.', async () => {
await goToPage(page, 'log-create&runNumbers=1,2,3&lhcFillNumbers=1,2,3');
await goToPage(page, 'log-create', { queryParameters: { runNumbers: '1,2,3', lhcFillNumbers: '1,2,3' } });

await expectInputValue(page, 'input#run-numbers', '1,2,3');
await expectInputValue(page, 'input#environments', '');
await expectInputValue(page, 'input#lhc-fills', '1,2,3');
});

it('Should verify that form autofill the environmentIds and lhcFillNumbers when leaving runNumbers empty.', async () => {
await goToPage(page, 'log-create&environmentIds=1,2,3&lhcFillNumbers=1,2,3');
await goToPage(page, 'log-create', { queryParameters: { environmentIds: '1,2,3', lhcFillNumbers: '1,2,3' } });

await expectInputValue(page, 'input#run-numbers', '');
await expectInputValue(page, 'input#environments', '1,2,3');
Expand Down

0 comments on commit 33c3c0f

Please sign in to comment.