diff --git a/tests/e2e/admin.test.ts b/tests/e2e/admin.test.ts index 5fa74b88344..bc1ab6f4673 100644 --- a/tests/e2e/admin.test.ts +++ b/tests/e2e/admin.test.ts @@ -17,6 +17,8 @@ test('create a bot and manage its access token', async ({page, request}) => { await page.getByRole('row', {name: /^user /}).getByRole('radio', {name: 'Read', exact: true}).check(); await page.getByRole('button', {name: 'Generate Token'}).click(); const token = await page.getByRole('code').textContent(); + await page.getByRole('button', {name: 'Copy', exact: true}).click(); + await expect.poll(() => page.evaluate(() => navigator.clipboard.readText())).toBe(token); const response = await request.get('/api/v1/user', {headers: {Authorization: `token ${token}`}}); expect(await response.json()).toMatchObject({login: botName, type: 'Bot'}); diff --git a/web_src/js/modules/clipboard.ts b/web_src/js/modules/clipboard.ts index 19a76a32ca7..96fa2ab0f2c 100644 --- a/web_src/js/modules/clipboard.ts +++ b/web_src/js/modules/clipboard.ts @@ -64,7 +64,7 @@ function replaceWithFeedbackSvg(origSvg: SVGElement, success: boolean): () => vo // Enable clipboard copy from HTML attributes. These properties are supported: // - data-clipboard-text: Direct text to copy -// - data-clipboard-target: Holds a selector for an element. "value" of or