feat(admin): ask for the contributor's address when creating a link (#260)
The address is now a required field beside the label, the links table shows where each link was sent, and the admin is told plainly when the mail did not go — with the link still on screen to copy, which is the case that matters in QA and in local development where there is no mail at all. Two specs in unrelated features created links with only a label and the route now refuses that, so they are updated here rather than left to go red on somebody else's branch. That is the cost of making the address required, and it is a small one: the compiler and the suite find every call site. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -17,6 +17,7 @@ test.describe('Managing upload links', () => {
|
||||
await page.getByRole('tab', { name: 'Upload links' }).click();
|
||||
|
||||
await page.getByLabel('Link label').fill(label);
|
||||
await page.getByLabel('Contributor email').fill(`${uniqueSuffix()}@example.com`);
|
||||
await page.getByRole('button', { name: 'Create link' }).click();
|
||||
|
||||
// Shown exactly once. The server keeps only a digest, so there is no
|
||||
@@ -38,6 +39,7 @@ test.describe('Managing upload links', () => {
|
||||
await admin.goto();
|
||||
await page.getByRole('tab', { name: 'Upload links' }).click();
|
||||
await page.getByLabel('Link label').fill(label);
|
||||
await page.getByLabel('Contributor email').fill(`${uniqueSuffix()}@example.com`);
|
||||
await page.getByRole('button', { name: 'Create link' }).click();
|
||||
|
||||
const row = page.getByRole('row', { name: new RegExp(label) });
|
||||
@@ -61,6 +63,7 @@ test.describe('Managing upload links', () => {
|
||||
await admin.goto();
|
||||
await page.getByRole('tab', { name: 'Upload links' }).click();
|
||||
await page.getByLabel('Link label').fill(label);
|
||||
await page.getByLabel('Contributor email').fill(`${uniqueSuffix()}@example.com`);
|
||||
await page.getByText('No limit').click();
|
||||
await page.getByRole('button', { name: 'Create link' }).click();
|
||||
|
||||
@@ -69,4 +72,14 @@ test.describe('Managing upload links', () => {
|
||||
// A bare count rather than "0 of N".
|
||||
await expect(row.getByText('0 of', { exact: false })).toHaveCount(0);
|
||||
});
|
||||
|
||||
// The address is the point of the change: a link nobody can be sent is the
|
||||
// thing this replaced.
|
||||
test('will not create a link without an address', async ({ page, admin }) => {
|
||||
await admin.goto();
|
||||
await page.getByRole('tab', { name: 'Upload links' }).click();
|
||||
await page.getByLabel('Link label').fill(`Nameless ${uniqueSuffix()}`);
|
||||
|
||||
await expect(page.getByRole('button', { name: 'Create link' })).toBeDisabled();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user