fix: copy new access token to clipboard (#39496)

Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
wxiaoguang
2026-09-30 21:41:55 +08:00
committed by GitHub
parent cc95f141f8
commit 0b43bde974
2 changed files with 4 additions and 4 deletions
+2
View File
@@ -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'});