fix(zone-modal): center slider thumb on track, drop dead code, cover a11y
- Center webkit slider thumb on 4px track (margin-top: -4.5px) so the opacity bullet no longer sits below the bar. - Drop redundant inline accentColor; CSS module owns track color. - Remove dead ::-ms-* prefix rules. - Tests: assert aria-labels on grid/select triggers, cover getFontLabel happy path + unknown-value fallback via the Font selector DOM.
This commit is contained in:
@@ -37,6 +37,16 @@ describe('GroupRectModal', () => {
|
||||
expect(submitted.z_order).toBe(1)
|
||||
})
|
||||
|
||||
it('exposes aria-labels on grid buttons and select triggers', () => {
|
||||
render(<GroupRectModal open onClose={vi.fn()} onSubmit={vi.fn()} />)
|
||||
expect(screen.getByLabelText('Font selector')).toBeDefined()
|
||||
expect(screen.getByLabelText('Z-order selector')).toBeDefined()
|
||||
expect(screen.getByLabelText('Text position ↘')).toBeDefined()
|
||||
expect(screen.getByLabelText('Label position Inside')).toBeDefined()
|
||||
expect(screen.getByLabelText('Border style Solid')).toBeDefined()
|
||||
expect(screen.getByLabelText('Border width 1px')).toBeDefined()
|
||||
})
|
||||
|
||||
it('calls onClose when Cancel is clicked', () => {
|
||||
const onClose = vi.fn()
|
||||
render(<GroupRectModal open onClose={onClose} onSubmit={vi.fn()} />)
|
||||
@@ -308,3 +318,24 @@ describe('GroupRectModal', () => {
|
||||
expect(screen.getByText(/Background 5%/)).toBeInTheDocument()
|
||||
})
|
||||
})
|
||||
|
||||
describe('GroupRectModal font label rendering', () => {
|
||||
it('renders the human font label in the Select trigger (default inter)', () => {
|
||||
render(<GroupRectModal open onClose={vi.fn()} onSubmit={vi.fn()} />)
|
||||
const trigger = screen.getByLabelText('Font selector')
|
||||
expect(trigger.textContent).toContain('Inter (sans-serif)')
|
||||
})
|
||||
|
||||
it('falls back to raw value when font is unknown', () => {
|
||||
render(
|
||||
<GroupRectModal
|
||||
open
|
||||
onClose={vi.fn()}
|
||||
onSubmit={vi.fn()}
|
||||
initial={{ font: 'comic-sans-9000' }}
|
||||
/>
|
||||
)
|
||||
const trigger = screen.getByLabelText('Font selector')
|
||||
expect(trigger.textContent).toContain('comic-sans-9000')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user