Keep the result fixture compatible with strict TypeScript
This commit is contained in:
@@ -88,7 +88,8 @@ test('opens a single result automatically and shows each result at its own devic
|
|||||||
if (id === operationId || id === multiOperationId) return r.fulfill({ json: {
|
if (id === operationId || id === multiOperationId) return r.fulfill({ json: {
|
||||||
operation_id: id, customer_name: 'Nord', title: script.name, approval_state: 'approved',
|
operation_id: id, customer_name: 'Nord', title: script.name, approval_state: 'approved',
|
||||||
execution_state: id === operationId ? 'succeeded' : 'partially_succeeded',
|
execution_state: id === operationId ? 'succeeded' : 'partially_succeeded',
|
||||||
targets: [linux, windows], jobs: id === operationId ? [jobs[0]] : jobs
|
targets: id === operationId ? [linux] : [linux, windows],
|
||||||
|
jobs: id === operationId ? jobs.slice(0, 1) : jobs
|
||||||
} });
|
} });
|
||||||
}
|
}
|
||||||
const job = jobs.find(item => pathname === api + '/jobs/' + item.job_id);
|
const job = jobs.find(item => pathname === api + '/jobs/' + item.job_id);
|
||||||
@@ -109,7 +110,7 @@ test('opens a single result automatically and shows each result at its own devic
|
|||||||
await expect(page.getByRole('heading', { name: 'Ergebnis für test-linux' })).toBeVisible();
|
await expect(page.getByRole('heading', { name: 'Ergebnis für test-linux' })).toBeVisible();
|
||||||
await expect(page.getByLabel('stdout Textansicht')).toHaveText('Linux');
|
await expect(page.getByLabel('stdout Textansicht')).toHaveText('Linux');
|
||||||
await expect(page.getByText('Exitcode 0', { exact: true })).toBeVisible();
|
await expect(page.getByText('Exitcode 0', { exact: true })).toBeVisible();
|
||||||
expect([...resultReads]).toEqual([jobs[0].job_id]);
|
expect([...resultReads]).toEqual(jobs.slice(0, 1).map(job => job.job_id));
|
||||||
|
|
||||||
await page.setViewportSize({ width: 390, height: 844 });
|
await page.setViewportSize({ width: 390, height: 844 });
|
||||||
resultReads.clear();
|
resultReads.clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user