Complete customer transfers on first authenticated inventory
Rust development slice / linux (push) Failing after 8s
Rust development slice / linux (push) Failing after 8s
This commit is contained in:
@@ -232,6 +232,7 @@ test('moves an existing pairing through the WebUI and waits for target inventory
|
||||
target_asset_id: 'new-asset', target_agent_id: 'new-agent', target_hostname: 'NORD-PC' };
|
||||
let state = '';
|
||||
let canEnroll = false;
|
||||
let posts = 0;
|
||||
const listing = (items: unknown[]) => ({ items, next_cursor: null, truncated: false,
|
||||
completeness: 'complete', as_of: new Date().toISOString() });
|
||||
await page.route(origin + '/auth/config', r => r.fulfill({ json: {
|
||||
@@ -257,14 +258,10 @@ test('moves an existing pairing through the WebUI and waits for target inventory
|
||||
expect(req.headers()['x-csrf-token']).toBe('move-csrf');
|
||||
expect(req.headers()['x-rmm-tenant']).toBe(source.tenant_id);
|
||||
expect(url.searchParams.get('agent_id')).toBe(device.agent_id);
|
||||
if (url.pathname === move) {
|
||||
expect(req.postDataJSON()).toEqual({ target_tenant_id: target.tenant_id });
|
||||
state = 'pending';
|
||||
} else {
|
||||
expect(url.pathname).toBe(move + '/move-fixture/complete');
|
||||
expect(state).toBe('ready');
|
||||
state = 'completed';
|
||||
}
|
||||
expect(url.pathname).toBe(move);
|
||||
expect(req.postDataJSON()).toEqual({ target_tenant_id: target.tenant_id });
|
||||
posts++;
|
||||
state = 'pending';
|
||||
return r.fulfill({ json: { state } });
|
||||
}
|
||||
return r.fulfill({ status: 404, json: { code: 'NOT_FOUND' } });
|
||||
@@ -275,22 +272,23 @@ test('moves an existing pairing through the WebUI and waits for target inventory
|
||||
await page.getByText('Kunden wechseln', { exact: true }).click();
|
||||
await page.getByRole('combobox', { name: 'Zielkunde', exact: true }).selectOption(target.tenant_id);
|
||||
await expect(page.getByText('Für diesen Zielkunden fehlt das Recht', { exact: false })).toBeVisible();
|
||||
const prepare = page.getByRole('button', { name: 'Kundenwechsel vormerken' });
|
||||
const prepare = page.getByRole('button', { name: 'Kundenwechsel starten' });
|
||||
await expect(prepare).toBeDisabled();
|
||||
await page.getByRole('combobox', { name: 'Zielkunde', exact: true }).selectOption('');
|
||||
canEnroll = true;
|
||||
await page.getByRole('combobox', { name: 'Zielkunde', exact: true }).selectOption(target.tenant_id);
|
||||
await prepare.click();
|
||||
await expect(page.getByText('Der Wechsel ist vorgemerkt.', { exact: false })).toBeVisible();
|
||||
const finish = page.getByRole('button', { name: 'Kundenwechsel abschließen' });
|
||||
await expect(finish).toHaveCount(0);
|
||||
state = 'ready';
|
||||
await expect(finish).toBeDisabled({ timeout: 10000 });
|
||||
await page.getByRole('checkbox', { name: 'Ich bestätige den Kundenwechsel für dieses Gerät.' }).check();
|
||||
await finish.click();
|
||||
await expect(page.getByText('Kundenwechsel abgeschlossen.', { exact: false })).toBeVisible();
|
||||
await expect(page.getByRole('link', { name: 'Neue Kopplung öffnen' })).toHaveAttribute('href',
|
||||
const destination = page.getByRole('link', { name: 'Neue Kopplung öffnen' });
|
||||
state = 'enrolled';
|
||||
await expect(page.getByText('Der Wechsel wird mit der ersten Inventarmeldung', { exact: false }))
|
||||
.toBeVisible({ timeout: 10000 });
|
||||
await expect(destination).toHaveCount(0);
|
||||
state = 'completed';
|
||||
await expect(page.getByText('Kundenwechsel abgeschlossen.', { exact: false })).toBeVisible({ timeout: 10000 });
|
||||
await expect(destination).toHaveAttribute('href',
|
||||
'#geraete/' + target.tenant_id + '/new-asset/new-agent');
|
||||
expect(posts).toBe(1);
|
||||
});
|
||||
|
||||
test('shows real VM hosts and the Hetzner placeholder without adding a device', async ({ page }) => {
|
||||
|
||||
Reference in New Issue
Block a user