Skip to content

Commit a2c2ca4

Browse files
papysansclaude
andcommitted
fix(frontend): 补充 book_id 输入可访问名称
为番茄 book_id 输入框补充可访问名称,避免辅助技术无法命中该输入。 补充对应回归测试,防止后续重构再次丢失该可访问性语义。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e3b053b commit a2c2ca4

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

frontend/src/pages/ChapterWorkbenchPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,6 +1330,7 @@ export default function ChapterWorkbenchPage() {
13301330
<input
13311331
type="text"
13321332
className="input"
1333+
aria-label="番茄 book_id"
13331334
style={{ width: 120, fontSize: '0.78rem', padding: '2px 6px' }}
13341335
value={fanqieBookIdInput}
13351336
placeholder="未绑定"

frontend/src/pages/__tests__/ChapterWorkbenchPage.test.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,15 @@ describe('ChapterWorkbenchPage', () => {
339339
})
340340
})
341341

342+
it('book_id 输入框提供可访问名称', async () => {
343+
renderPage()
344+
await waitFor(() => {
345+
expect(screen.getByText('book_id:')).toBeTruthy()
346+
})
347+
348+
expect(screen.getByLabelText('番茄 book_id')).toBeTruthy()
349+
})
350+
342351
it('book_id 输入框会在用户编辑后仍跟随项目 store 刷新后的值更新', async () => {
343352
const view = renderPage()
344353
await waitFor(() => {

0 commit comments

Comments
 (0)