fix: accessibility issues for builder's design

This commit is contained in:
Florian Sylvain committed 2026-10-20 05:11:14 +02:00
1 parent 8e344b2500
commit 76e9e1220c
16 files changed
+290 -147

No files matched your search

@@ -318,13 +318,15 @@ describe('Field errors (design state 5)', () => {
expect(chip()).toBe('3 problems to fix')
expect(saveButton()!.disabled).toBe(true)
expect(all('[data-testid="field-row-alert"]')).toHaveLength(3)
expect(all('[data-testid="field-row-alert"]')).toHaveLength(2)
expect(text(inspector())).toContain("Choices can't be blank.")
expect(text(inspector())).toContain('Two choices are the same.')
await selectRow('Capacity')
expect(text(inspector())).toContain("Lowest value can't be above the highest value.")
await selectRow('Untitled field')
expect(text(inspector())).toContain('Give the field a label.')
await selectRow('Title')
expect(all('[data-testid="field-row-alert"]')).toHaveLength(3)
})
it('shows a single key error for a new field and none for a saved field', async () => {
@@ -650,6 +650,7 @@ describe('Refused (design state 15 and group 3, state 3)', () => {
await click(button('Apply changes'))
await click(button('Back to editing'))
await vi.waitFor(() => expect(dialog()).toBeNull())
await selectRow('Ends on')
expect(badgesOf('Capacity')).toContain('Possible cause')
answer = (body) => updatedType('events', body)
@@ -187,6 +187,7 @@ describe('When errors are shown', () => {
await typeInto(el<HTMLInputElement>('input[name="label"]'), 'x')
await typeInto(el<HTMLInputElement>('input[name="label"]'), '')
await click(rows()[0]!.querySelector('[data-field-row]'))
const invalid = rows().filter((row) => row.querySelector('[data-testid="field-row-alert"]'))
expect(invalid).toHaveLength(1)
expect(invalid[0]!.className).toContain('border-error')
@@ -81,12 +81,10 @@ describe('Field list rows', () => {
await addField('Second')
const first = rows()[0]!
expect(text(first.querySelector('[data-testid="field-row-badges"]'))).toBe(
'New Required Unique',
)
expect(text(first.querySelector('[data-testid="field-row-badges"]'))).toBe('New R U')
expect(first.querySelector('[data-action]')).toBeNull()
const selected = rows()[1]!
expect(selected.className).toContain('bg-(--rc-sand)')
expect(selected.className).toContain('bg-(--rc-sel)')
expect(
[...selected.querySelectorAll('[data-action]')].map((node) =>
node.getAttribute('aria-label'),