diff --git a/app/forms/ssh-key-edit.tsx b/app/forms/ssh-key-edit.tsx index 6e7b16155..609ec225c 100644 --- a/app/forms/ssh-key-edit.tsx +++ b/app/forms/ssh-key-edit.tsx @@ -33,8 +33,6 @@ export function EditSSHKeySideModalForm() { const navigate = useNavigate() const { sshKey } = useSshKeySelector() - const onDismiss = () => navigate(pb.sshKeys()) - const { data } = usePrefetchedApiQuery('currentUserSshKeyView', { path: { sshKey }, }) @@ -46,7 +44,8 @@ export function EditSSHKeySideModalForm() { form={form} formType="edit" resourceName="SSH key" - onDismiss={onDismiss} + title="View SSH key" + onDismiss={() => navigate(pb.sshKeys())} subtitle={ {data.name} diff --git a/app/routes.tsx b/app/routes.tsx index 57d3f52a7..19e8e671a 100644 --- a/app/routes.tsx +++ b/app/routes.tsx @@ -124,7 +124,7 @@ export const routes = createRoutesFromElements( path=":sshKey/edit" loader={EditSSHKeySideModalForm.loader} element={} - handle={titleCrumb('Edit SSH Key')} + handle={titleCrumb('View SSH Key')} /> diff --git a/test/e2e/ssh-keys.e2e.ts b/test/e2e/ssh-keys.e2e.ts index c537dafbd..6670b43b2 100644 --- a/test/e2e/ssh-keys.e2e.ts +++ b/test/e2e/ssh-keys.e2e.ts @@ -23,9 +23,8 @@ test('SSH keys', async ({ page }) => { await page.getByRole('link', { name: 'm1-macbook-pro' }).click() // verify side modal content - const modal = page.getByRole('dialog') + const modal = page.getByRole('dialog', { name: 'View SSH key' }) await expect(modal).toBeVisible() - await expect(modal.getByText('Edit SSH key')).toBeVisible() await expect(modal.getByRole('heading', { name: 'm1-macbook-pro' })).toBeVisible() const propertiesTable = modal.locator('.properties-table')