cleanup path examples

This commit is contained in:
findthelorax
2026-04-19 23:07:26 -04:00
committed by Remy
parent c7be851c34
commit 2c94616afa
2 changed files with 6 additions and 6 deletions
@@ -316,7 +316,7 @@ describe('DetailPanel', () => {
const addHeaders = screen.getAllByText('Add')
fireEvent.click(addHeaders[addHeaders.length - 1])
fireEvent.change(screen.getByPlaceholderText('Service name'), { target: { value: 'health' } })
fireEvent.change(screen.getByPlaceholderText('Path (/dashboard)'), { target: { value: 'healthz' } })
fireEvent.change(screen.getByPlaceholderText('Path (/admin)'), { target: { value: 'healthz' } })
fireEvent.click(screen.getAllByRole('button', { name: 'Add' }).at(-1) as HTMLButtonElement)
expect(updateNode).toHaveBeenCalledOnce()
@@ -365,9 +365,9 @@ describe('DetailPanel', () => {
fireEvent.click(editBtn)
const nameInput = screen.getByPlaceholderText('Service name') as HTMLInputElement
expect(nameInput.value).toBe('nginx')
const portInput = screen.getByPlaceholderText('Port (/dashboard)') as HTMLInputElement
const portInput = screen.getByPlaceholderText('Port (/admin)') as HTMLInputElement
expect(portInput.value).toBe('80')
const pathInput = screen.getByPlaceholderText('Path (/dashboard)') as HTMLInputElement
const pathInput = screen.getByPlaceholderText('Path (/admin)') as HTMLInputElement
expect(pathInput.value).toBe('/admin')
})
@@ -387,13 +387,13 @@ describe('DetailPanel', () => {
const nameInput = screen.getByPlaceholderText('Service name')
fireEvent.change(nameInput, { target: { value: 'apache' } })
fireEvent.change(screen.getByPlaceholderText('Path (/dashboard)'), { target: { value: '/ui' } })
fireEvent.change(screen.getByPlaceholderText('Path (/admin)'), { target: { value: '/admin' } })
fireEvent.click(screen.getByRole('button', { name: 'Save' }))
expect(updateNode).toHaveBeenCalledOnce()
expect(updateNode.mock.calls[0][1].services[0].service_name).toBe('apache')
expect(updateNode.mock.calls[0][1].services[0].port).toBe(80)
expect(updateNode.mock.calls[0][1].services[0].path).toBe('/ui')
expect(updateNode.mock.calls[0][1].services[0].path).toBe('admin')
})
it('cancels edit without updating', () => {