mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-07-09 16:00:59 +00:00
Retire two more specs pinned to removed unified-route contracts
The TrueNAS storage-links spec asserted cross-links from the retired /infrastructure card into the retired /workloads, /storage, and /recovery routes, and the VMware source-filter spec asserted the retired /infrastructure source dropdown; platform-first navigation replaced both concepts with the per-platform pages and their section navigation, which the platform-pages shell spec covers.
This commit is contained in:
parent
425400f38e
commit
e3ebbbcdc7
2 changed files with 0 additions and 273 deletions
|
|
@ -1,159 +0,0 @@
|
|||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { test as base, expect } from '@playwright/test';
|
||||
import { createAuthenticatedStorageState } from './helpers';
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
type WorkerFixtures = {
|
||||
authStorageStatePath: string;
|
||||
};
|
||||
|
||||
const SCREENSHOT_PATH = '/tmp/truenas-infrastructure-storage-recovery-links.png';
|
||||
|
||||
const test = base.extend<{}, WorkerFixtures>({
|
||||
storageState: async ({ authStorageStatePath }, use) => {
|
||||
await use(authStorageStatePath);
|
||||
},
|
||||
authStorageStatePath: [async ({ browser }, use, workerInfo) => {
|
||||
const storageStatePath = path.resolve(
|
||||
__dirname,
|
||||
'..',
|
||||
'..',
|
||||
'tmp',
|
||||
'playwright-auth',
|
||||
`truenas-infrastructure-storage-links-${workerInfo.project.name}.json`,
|
||||
);
|
||||
fs.mkdirSync(path.dirname(storageStatePath), { recursive: true });
|
||||
await createAuthenticatedStorageState(browser, storageStatePath);
|
||||
try {
|
||||
await use(storageStatePath);
|
||||
} finally {
|
||||
fs.rmSync(storageStatePath, { force: true });
|
||||
}
|
||||
}, { scope: 'worker' }],
|
||||
});
|
||||
|
||||
test.describe('TrueNAS infrastructure storage and recovery links', () => {
|
||||
test.setTimeout(180_000);
|
||||
|
||||
test('surfaces canonical workloads, storage, and recovery links for top-level TrueNAS systems', async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.route('**/api/resources**', async (route) => {
|
||||
const requestUrl = new URL(route.request().url());
|
||||
|
||||
if (requestUrl.pathname === '/api/resources') {
|
||||
await route.fulfill({
|
||||
status: 200,
|
||||
contentType: 'application/json',
|
||||
body: JSON.stringify({
|
||||
data: [
|
||||
{
|
||||
id: 'truenas-main',
|
||||
type: 'agent',
|
||||
name: 'truenas-main',
|
||||
displayName: 'TrueNAS Main',
|
||||
platformId: 'truenas-main',
|
||||
platformType: 'truenas',
|
||||
sourceType: 'hybrid',
|
||||
sources: ['agent', 'truenas'],
|
||||
status: 'online',
|
||||
lastSeen: '2026-03-29T22:00:00Z',
|
||||
canonicalIdentity: {
|
||||
displayName: 'TrueNAS Main',
|
||||
hostname: 'truenas-main',
|
||||
platformId: 'truenas-main',
|
||||
},
|
||||
platformData: {
|
||||
sources: ['agent', 'truenas'],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'storage-truenas-display',
|
||||
type: 'storage',
|
||||
name: 'tank',
|
||||
displayName: 'tank',
|
||||
parentId: 'truenas-main',
|
||||
parentName: 'TrueNAS Main',
|
||||
platformId: 'truenas-1',
|
||||
platformType: 'truenas',
|
||||
sourceType: 'api',
|
||||
sources: ['truenas'],
|
||||
status: 'online',
|
||||
lastSeen: '2026-03-29T22:00:00Z',
|
||||
canonicalIdentity: {
|
||||
displayName: 'tank',
|
||||
platformId: 'truenas-1',
|
||||
},
|
||||
storage: {
|
||||
platform: 'truenas',
|
||||
type: 'zfs-pool',
|
||||
topology: 'pool',
|
||||
},
|
||||
platformData: {
|
||||
sources: ['truenas'],
|
||||
},
|
||||
},
|
||||
],
|
||||
meta: {
|
||||
page: 1,
|
||||
limit: 200,
|
||||
total: 2,
|
||||
totalPages: 1,
|
||||
},
|
||||
}),
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (requestUrl.pathname === '/api/resources/truenas-main/facets') {
|
||||
await route.fulfill({
|
||||
status: 200,
|
||||
contentType: 'application/json',
|
||||
body: JSON.stringify({
|
||||
recentChanges: [],
|
||||
counts: {
|
||||
recentChanges: 0,
|
||||
},
|
||||
}),
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await route.continue();
|
||||
});
|
||||
|
||||
await page.goto('/infrastructure?source=truenas&resource=truenas-main', {
|
||||
waitUntil: 'domcontentloaded',
|
||||
});
|
||||
|
||||
await expect(page).toHaveURL(/\/infrastructure\?source=truenas&resource=truenas-main/);
|
||||
await expect(page.getByTestId('infrastructure-page')).toBeVisible();
|
||||
await page.getByRole('button', { name: 'List' }).click();
|
||||
|
||||
const showAccessButton = page.getByRole('button', { name: 'Show access' });
|
||||
await expect(showAccessButton).toBeVisible();
|
||||
await showAccessButton.click();
|
||||
|
||||
const workloadsLink = page.getByRole('link', { name: 'Open related workloads for TrueNAS Main' });
|
||||
const storageLink = page.getByRole('link', { name: 'Open related storage for TrueNAS Main' });
|
||||
const recoveryLink = page.getByRole('link', { name: 'Open related recovery for TrueNAS Main' });
|
||||
|
||||
await expect(workloadsLink).toHaveAttribute(
|
||||
'href',
|
||||
'/workloads?type=app-container&platform=truenas&agent=truenas-main',
|
||||
);
|
||||
await expect(storageLink).toHaveAttribute(
|
||||
'href',
|
||||
'/storage?source=truenas&node=truenas-main',
|
||||
);
|
||||
await expect(recoveryLink).toHaveAttribute(
|
||||
'href',
|
||||
'/recovery?platform=truenas&node=truenas-main',
|
||||
);
|
||||
|
||||
await page.screenshot({ path: SCREENSHOT_PATH, fullPage: true });
|
||||
});
|
||||
});
|
||||
|
|
@ -1,114 +0,0 @@
|
|||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { expect, test as base } from '@playwright/test';
|
||||
|
||||
import { createAuthenticatedStorageState } from './helpers';
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const SCREENSHOT_PATH = '/tmp/vmware-infrastructure-source-filter.png';
|
||||
|
||||
type WorkerFixtures = {
|
||||
authStorageStatePath: string;
|
||||
};
|
||||
|
||||
const test = base.extend<{}, WorkerFixtures>({
|
||||
storageState: async ({ authStorageStatePath }, use) => {
|
||||
await use(authStorageStatePath);
|
||||
},
|
||||
authStorageStatePath: [async ({ browser }, use, workerInfo) => {
|
||||
const storageStatePath = path.resolve(
|
||||
__dirname,
|
||||
'..',
|
||||
'..',
|
||||
'tmp',
|
||||
'playwright-auth',
|
||||
`vmware-infrastructure-source-filter-${workerInfo.project.name}.json`,
|
||||
);
|
||||
fs.mkdirSync(path.dirname(storageStatePath), { recursive: true });
|
||||
await createAuthenticatedStorageState(browser, storageStatePath);
|
||||
try {
|
||||
await use(storageStatePath);
|
||||
} finally {
|
||||
fs.rmSync(storageStatePath, { force: true });
|
||||
}
|
||||
}, { scope: 'worker' }],
|
||||
});
|
||||
|
||||
test.describe('VMware infrastructure source filter', () => {
|
||||
test.setTimeout(180_000);
|
||||
|
||||
test('surfaces VMware resources under the canonical vSphere infrastructure filter', async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.route('**/api/resources**', async (route) => {
|
||||
const requestUrl = new URL(route.request().url());
|
||||
if (requestUrl.pathname !== '/api/resources') {
|
||||
await route.continue();
|
||||
return;
|
||||
}
|
||||
|
||||
await route.fulfill({
|
||||
status: 200,
|
||||
contentType: 'application/json',
|
||||
body: JSON.stringify({
|
||||
data: [
|
||||
{
|
||||
id: 'vmware-host-1',
|
||||
type: 'agent',
|
||||
name: 'esxi-01.lab.local',
|
||||
displayName: 'ESXi 01',
|
||||
platformId: 'vmware-host-1',
|
||||
platformType: 'vmware-vsphere',
|
||||
sourceType: 'api',
|
||||
sources: ['vmware-vsphere'],
|
||||
status: 'online',
|
||||
lastSeen: '2026-03-30T17:00:00Z',
|
||||
canonicalIdentity: {
|
||||
displayName: 'ESXi 01',
|
||||
hostname: 'esxi-01.lab.local',
|
||||
platformId: 'vmware-host-1',
|
||||
},
|
||||
agent: {
|
||||
hostname: 'esxi-01.lab.local',
|
||||
platform: 'VMware ESXi',
|
||||
uptimeSeconds: 86400,
|
||||
},
|
||||
platformData: {
|
||||
sources: ['vmware-vsphere'],
|
||||
},
|
||||
},
|
||||
],
|
||||
meta: {
|
||||
page: 1,
|
||||
limit: 200,
|
||||
total: 1,
|
||||
totalPages: 1,
|
||||
},
|
||||
}),
|
||||
});
|
||||
});
|
||||
|
||||
await page.goto('/infrastructure?source=vmware-vsphere', {
|
||||
waitUntil: 'domcontentloaded',
|
||||
});
|
||||
|
||||
await expect(page.getByTestId('infrastructure-page')).toBeVisible();
|
||||
await expect(page).toHaveURL(/\/infrastructure\?source=vmware-vsphere/);
|
||||
await expect(page.locator('#infra-source-filter')).toHaveValue('vmware-vsphere');
|
||||
|
||||
const sourceOptions = await page.locator('#infra-source-filter option').evaluateAll((options) =>
|
||||
options.map((option) => ({
|
||||
value: option.getAttribute('value'),
|
||||
label: option.textContent?.trim(),
|
||||
})),
|
||||
);
|
||||
expect(sourceOptions).toEqual([
|
||||
{ value: '', label: 'All' },
|
||||
{ value: 'vmware-vsphere', label: 'vSphere' },
|
||||
]);
|
||||
|
||||
await expect(page.getByText('ESXi 01')).toBeVisible();
|
||||
await page.screenshot({ path: SCREENSHOT_PATH, fullPage: true });
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue