test(ui) : couvre icône/label readonly vide sur la famille champs
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -296,12 +296,23 @@ describe('MalioInputPhone', () => {
|
||||
})
|
||||
|
||||
it('readonly : pas d\'apparence désactivée (pas opacity-40)', () => {
|
||||
const wrapper = mountComponent({label: 'Tel', readonly: true})
|
||||
expect(wrapper.get('input').classes()).not.toContain('opacity-40')
|
||||
const wrapper = mountComponent({label: 'Tel', addable: true, readonly: true})
|
||||
// opacity-40 was only ever applied to the add button, not the input
|
||||
expect(wrapper.get('[data-test="add-button"]').classes()).not.toContain('opacity-40')
|
||||
// and the input is not natively disabled in readonly:
|
||||
expect(wrapper.get('input').attributes('disabled')).toBeUndefined()
|
||||
})
|
||||
|
||||
it('readonly vide : label en text-m-muted', () => {
|
||||
const wrapper = mountComponent({label: 'Tel', readonly: true})
|
||||
expect(wrapper.get('label').classes()).toContain('text-m-muted')
|
||||
})
|
||||
|
||||
it('readonly rempli : label en text-black', () => {
|
||||
const wrapper = mountComponent({label: 'Tel', readonly: true, modelValue: '+33612345678'})
|
||||
expect(wrapper.get('label').classes()).toContain('text-black')
|
||||
})
|
||||
|
||||
it('renders the default add icon (mdi:plus)', () => {
|
||||
const wrapper = mountComponent({addable: true})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user