Skip to content

Commit

Permalink
take inventory switches tab back out, DB is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
david-crespo committed Dec 13, 2024
1 parent 2a13902 commit c1ebd8d
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 70 deletions.
1 change: 0 additions & 1 deletion app/pages/system/inventory/InventoryPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export function InventoryPage() {
<RouteTabs fullWidth>
<Tab to={pb.sledInventory()}>Sleds</Tab>
<Tab to={pb.diskInventory()}>Disks</Tab>
<Tab to={pb.switchInventory()}>Switches</Tab>
</RouteTabs>
</>
)
Expand Down
36 changes: 0 additions & 36 deletions app/pages/system/inventory/SwitchesTab.tsx

This file was deleted.

2 changes: 0 additions & 2 deletions app/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ import { InventoryPage } from './pages/system/inventory/InventoryPage'
import * as SledInstances from './pages/system/inventory/sled/SledInstancesTab'
import * as SledPage from './pages/system/inventory/sled/SledPage'
import * as SledsTab from './pages/system/inventory/SledsTab'
import * as SwitchesTab from './pages/system/inventory/SwitchesTab'
import * as IpPool from './pages/system/networking/IpPoolPage'
import * as IpPools from './pages/system/networking/IpPoolsPage'
import * as SiloImages from './pages/system/SiloImagesPage'
Expand Down Expand Up @@ -165,7 +164,6 @@ export const routes = createRoutesFromElements(
<Route index element={<Navigate to="sleds" replace />} loader={SledsTab.loader} />
<Route path="sleds" {...SledsTab} handle={{ crumb: 'Sleds' }} />
<Route path="disks" {...DisksTab} handle={{ crumb: 'Disks' }} />
<Route path="switches" {...SwitchesTab} handle={{ crumb: 'Switches' }} />
</Route>
<Route path="inventory" handle={{ crumb: 'Inventory' }}>
<Route path="sleds" handle={{ crumb: 'Sleds' }}>
Expand Down
10 changes: 0 additions & 10 deletions app/util/__snapshots__/path-builder.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -581,16 +581,6 @@ exports[`breadcrumbs 2`] = `
"path": "/settings/ssh-keys",
},
],
"switchInventory (/system/inventory/switches)": [
{
"label": "Inventory",
"path": "/system/inventory/sleds",
},
{
"label": "Switches",
"path": "/system/inventory/switches",
},
],
"systemUtilization (/system/utilization)": [
{
"label": "Utilization",
Expand Down
1 change: 0 additions & 1 deletion app/util/path-builder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ test('path builder', () => {
"sshKeyEdit": "/settings/ssh-keys/ss/edit",
"sshKeys": "/settings/ssh-keys",
"sshKeysNew": "/settings/ssh-keys-new",
"switchInventory": "/system/inventory/switches",
"systemUtilization": "/system/utilization",
"vpc": "/projects/p/vpcs/v/firewall-rules",
"vpcEdit": "/projects/p/vpcs/v/edit",
Expand Down
1 change: 0 additions & 1 deletion app/util/path-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ export const pb = {

sledInventory: () => '/system/inventory/sleds',
diskInventory: () => '/system/inventory/disks',
switchInventory: () => '/system/inventory/switches',
sled: ({ sledId }: PP.Sled) => `/system/inventory/sleds/${sledId}/instances`,
sledInstances: ({ sledId }: PP.Sled) => `/system/inventory/sleds/${sledId}/instances`,

Expand Down
20 changes: 1 addition & 19 deletions test/e2e/inventory.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Copyright Oxide Computer Company
*/

import { physicalDisks, sleds, switches } from '@oxide/api-mocks'
import { physicalDisks, sleds } from '@oxide/api-mocks'

import { expect, expectRowVisible, expectVisible, test } from './utils'

Expand Down Expand Up @@ -85,21 +85,3 @@ test('Disk inventory page', async ({ page }) => {
state: 'decommissioned',
})
})

test('Switch inventory page', async ({ page }) => {
await page.goto('/system/inventory/switches')

await expectVisible(page, ['role=heading[name*="Inventory"]'])

const switchesTab = page.getByRole('tab', { name: 'Switches' })
await expect(switchesTab).toBeVisible()
await expect(switchesTab).toHaveClass(/is-selected/)

const table = page.getByRole('table')
await expectRowVisible(table, {
id: switches[0].id,
'part number': '832-0431906',
'serial number': 'BDS02141689',
revision: '1',
})
})

0 comments on commit c1ebd8d

Please sign in to comment.