Skip to content

Commit

Permalink
rename remove -> delete for IP pool ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
david-crespo committed Sep 3, 2024
1 parent f042ad4 commit fa8ed12
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions app/pages/system/networking/IpPoolPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ function IpRangesTable() {
const makeRangeActions = useCallback(
({ range }: IpPoolRange): MenuAction[] => [
{
label: 'Remove',
label: 'Delete',
className: 'destructive',
onActivate: () =>
confirmAction({
Expand All @@ -217,11 +217,11 @@ function IpRangesTable() {
path: { pool },
body: range,
}),
errorTitle: 'Could not remove range',
modalTitle: 'Confirm remove range',
errorTitle: 'Could not delete range',
modalTitle: 'Confirm delete range',
modalContent: (
<p>
Are you sure you want to remove range{' '}
Are you sure you want to delete range{' '}
<HL>
{range.first}&ndash;{range.last}
</HL>{' '}
Expand Down
12 changes: 6 additions & 6 deletions test/e2e/ip-pools.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,22 +258,22 @@ test('IP range validation and add', async ({ page }) => {
})
})

test('remove range', async ({ page }) => {
test('delete range', async ({ page }) => {
await page.goto('/system/networking/ip-pools/ip-pool-1')

const table = page.getByRole('table')
await expectRowVisible(table, { First: '10.0.0.20', Last: '10.0.0.22' })
await expect(table.getByRole('row')).toHaveCount(3) // header + 2 rows

await clickRowAction(page, '10.0.0.20', 'Remove')
await clickRowAction(page, '10.0.0.20', 'Delete')

const confirmModal = page.getByRole('dialog', { name: 'Confirm remove range' })
const confirmModal = page.getByRole('dialog', { name: 'Confirm delete range' })
await expect(confirmModal.getByText('range 10.0.0.20–10.0.0.22')).toBeVisible()

await page.getByRole('button', { name: 'Cancel' }).click()
await expect(confirmModal).toBeHidden()

await clickRowAction(page, '10.0.0.20', 'Remove')
await clickRowAction(page, '10.0.0.20', 'Delete')
await confirmModal.getByRole('button', { name: 'Confirm' }).click()

await expect(table.getByRole('cell', { name: '10.0.0.20' })).toBeHidden()
Expand Down Expand Up @@ -329,8 +329,8 @@ test('no ranges means no utilization bar', async ({ page }) => {
await expect(page.getByText('IPv4(IPs)')).toBeVisible()
await expect(page.getByText('IPv6(IPs)')).toBeVisible()

await clickRowAction(page, '10.0.0.50', 'Remove')
const confirmModal = page.getByRole('dialog', { name: 'Confirm remove range' })
await clickRowAction(page, '10.0.0.50', 'Delete')
const confirmModal = page.getByRole('dialog', { name: 'Confirm delete range' })
await confirmModal.getByRole('button', { name: 'Confirm' }).click()

await expect(page.getByText('IPv4(IPs)')).toBeHidden()
Expand Down

0 comments on commit fa8ed12

Please sign in to comment.