fix(e2e): use uniqueUsername helper in integration.spec

Date.now() can collide across workers running on the same millisecond
boundary. The worker-aware helper that the rest of the suite uses
side-steps that without changing the test's intent.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
MechaCat02
2026-05-28 19:41:47 +02:00
parent 79c8db2cb7
commit beb3bcb97c

View File

@@ -87,9 +87,12 @@ test('end-to-end: app + domain + script + route via dashboard → invoke via pub
});
test('api key minted via dashboard works as a CLI bearer, then revoke disables it', async ({
page
page,
uniqueUsername
}) => {
const name = `e2e-cli-${Date.now()}`;
// Worker-aware unique helper instead of Date.now() — keeps two
// workers from minting the same name on the same millisecond.
const name = uniqueUsername('cli');
// 1. Mint the key from /profile and capture the revealed token.
await page.goto('/admin/profile');