fix(titles): keep selected title ids generation-safe

This commit is contained in:
Xiaoxia AI
2026-06-24 01:13:01 +08:00
parent 17021c351f
commit b4dbad2e1e
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -112,7 +112,7 @@ test.describe('Core generation and download flow', () => {
await expect(page.getByText('项目生成任务')).toBeVisible({ timeout: 20_000 });
await page.locator('.ant-select-selector').first().click();
await page.getByText(`${libraryName} (video)`).click();
await page.getByLabel('标题').locator('.ant-select-selector').click();
await page.locator('.ant-select-selector').nth(2).click();
await page.getByText(projectTitleText).click();
await expect(page.getByText(/素材准备度:/)).toBeVisible({ timeout: 20_000 });
+1 -1
View File
@@ -47,7 +47,7 @@ test.describe('Project title library flow', () => {
await page.getByRole('button', { name: '新增标题' }).click();
await expect(page.getByText('标题已加入标题库')).toBeVisible({ timeout: 10_000 });
await expect(page.getByText(`E2E 标题 ${suffix}`)).toBeVisible({ timeout: 20_000 });
await expect(page.getByText('常用')).toBeVisible();
await expect(page.locator('.ant-list-item').filter({ hasText: `E2E 标题 ${suffix}` }).getByText('常用').first()).toBeVisible();
await page.getByPlaceholder('搜索标题').fill(`E2E 标题 ${suffix}`);
await expect(page.getByText(`E2E 标题 ${suffix}`)).toBeVisible();
await expect(page.getByText('使用次数:0')).toBeVisible();
@@ -29,7 +29,7 @@ class SQLAlchemyProjectTitleRepository:
) -> ProjectTitleModel:
now = datetime.now(timezone.utc)
item = ProjectTitleModel(
id=str(uuid4()),
id=uuid4().hex,
workspace_id=workspace_id,
project_id=project_id,
text=text.strip(),