feat(ui) : état readonly visuel sur pickers date/heure
Bordure noire forcée (même vide), suppression du bleu focus/primary, label et icône en text-black si rempli sinon text-m-muted, float piloté par isFilled uniquement en readonly. Bouton clear et astérisque inchangés. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -185,6 +185,32 @@ describe('MalioDate', () => {
|
||||
await wrapper.get('[data-test="date-input"]').trigger('click')
|
||||
expect(wrapper.find('[data-test="popover"]').exists()).toBe(false)
|
||||
})
|
||||
|
||||
it('readonly vide : bordure noire sans bleu', () => {
|
||||
const wrapper = mountDate({readonly: true})
|
||||
const input = wrapper.get('[data-test="date-input"]')
|
||||
expect(input.classes()).toContain('border-black')
|
||||
expect(input.classes()).not.toContain('border-m-muted')
|
||||
expect(input.classes()).not.toContain('focus:border-m-primary')
|
||||
})
|
||||
|
||||
it('readonly vide : label muted sans bleu', () => {
|
||||
const wrapper = mountDate({readonly: true, label: 'Date'})
|
||||
const label = wrapper.get('label')
|
||||
expect(label.classes()).toContain('text-m-muted')
|
||||
expect(label.classes()).not.toContain('text-m-primary')
|
||||
})
|
||||
|
||||
it('readonly rempli : label et icône en noir, bordure noire', () => {
|
||||
const wrapper = mountDate({readonly: true, label: 'Date', modelValue: '2026-05-19'})
|
||||
const input = wrapper.get('[data-test="date-input"]')
|
||||
const label = wrapper.get('label')
|
||||
const icon = wrapper.get('[data-test="calendar-icon"]')
|
||||
expect(input.classes()).toContain('border-black')
|
||||
expect(input.classes()).not.toContain('focus:border-m-primary')
|
||||
expect(label.classes()).toContain('text-black')
|
||||
expect(icon.classes()).toContain('text-black')
|
||||
})
|
||||
})
|
||||
|
||||
describe('accessibilité', () => {
|
||||
|
||||
Reference in New Issue
Block a user