Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sh text eol=lf
2 changes: 1 addition & 1 deletion web/src/components/ImpressionDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function ImpressionDialog({
}
}
return (
<Dialog open={open} onClose={onClose} label="个人印象">
<Dialog open={open} dismissible={false} onClose={onClose} label="个人印象">
<form
className="fastui-modal-body"
onSubmit={(event) => {
Expand Down
1 change: 1 addition & 0 deletions web/src/pages/Authors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ export default function Authors({ embedded = false }: { embedded?: boolean }) {
{content}
<Dialog
open={open}
dismissible={false}
onClose={() => setOpen(false)}
label={profile?.authors.some((a) => a.id === editing?.id) ? '编辑作者' : '新增作者'}
>
Expand Down
14 changes: 14 additions & 0 deletions web/tests/workspace.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ test('local login, impression, authors, inbox and logout persist across reloads'
await dialog
.getByLabel('研究印象', { exact: true })
.fill(`LLM prompt injection ${info.project.name}`)
await page.mouse.click(1, 1)
await expect(dialog).toBeVisible()
await expect(dialog.getByLabel('研究印象', { exact: true })).toHaveValue(
`LLM prompt injection ${info.project.name}`,
)
await dialog.getByRole('button', { name: '保存印象' }).click()
await expect(dialog).not.toBeVisible()
await page.reload()
Expand All @@ -89,7 +94,16 @@ test('local login, impression, authors, inbox and logout persist across reloads'
await visit(page, baseURL, 'authors')
await page.getByRole('button', { name: '添加作者', exact: true }).click()
const editor = page.getByRole('dialog', { name: '新增作者' })
await editor.getByRole('button', { name: '取消', exact: true }).click()
await expect(editor).not.toBeVisible()
await page.getByRole('button', { name: '添加作者', exact: true }).click()
await editor.getByRole('button', { name: '关闭编辑', exact: true }).click()
await expect(editor).not.toBeVisible()
await page.getByRole('button', { name: '添加作者', exact: true }).click()
await editor.getByLabel('姓名', { exact: true }).fill(`Alice ${info.project.name}`)
await page.mouse.click(1, 1)
await expect(editor).toBeVisible()
await expect(editor.getByLabel('姓名', { exact: true })).toHaveValue(`Alice ${info.project.name}`)
await editor.getByLabel('主页链接', { exact: true }).fill('http://127.0.0.1:9')
await editor.getByLabel('ML/AI Security', { exact: true }).check()
await editor.getByRole('button', { name: '保存作者' }).click()
Expand Down
Loading