🐛 Fixed staff user modal not showing correct example URL

fix https://linear.app/tryghost/issue/ENG-928/regression-author-url-slug-preview-broken

- simple change to append the slug to the end of the example hint
- also added test
This commit is contained in:
Daniel Lockyer 2024-07-01 09:54:30 +02:00 committed by Daniel Lockyer
parent f561f362f4
commit fa430666bf
2 changed files with 2 additions and 1 deletions

View File

@ -33,7 +33,7 @@ const BasicInputs: React.FC<UserDetailProps> = ({errors, clearError, user, setUs
onKeyDown={() => clearError('email')} onKeyDown={() => clearError('email')}
/> />
<TextField <TextField
hint="https://example.com/author" hint={`https://example.com/author/${user.slug}`}
maxLength={191} maxLength={191}
title="Slug" title="Slug"
value={user.slug} value={user.slug}

View File

@ -151,6 +151,7 @@ test.describe('User profile', async () => {
await modal.getByLabel('Full name').fill('New Admin'); await modal.getByLabel('Full name').fill('New Admin');
await modal.getByLabel('Email').fill('newadmin@test.com'); await modal.getByLabel('Email').fill('newadmin@test.com');
await modal.getByLabel('Slug').fill('newadmin'); await modal.getByLabel('Slug').fill('newadmin');
await expect(modal.getByText('https://example.com/author/newadmin')).toBeVisible();
await modal.getByLabel('Location').fill('some location'); await modal.getByLabel('Location').fill('some location');
await modal.getByLabel('Website').fill('https://example.com'); await modal.getByLabel('Website').fill('https://example.com');
await modal.getByLabel('Facebook profile').fill('fb'); await modal.getByLabel('Facebook profile').fill('fb');