| Numéro du ticket | Titre du ticket | |------------------|-----------------| | | | ## Description de la PR ## Modification du .env ## Check list - [ ] Pas de régression - [ ] TU/TI/TF rédigée - [ ] TU/TI/TF OK - [ ] CHANGELOG modifié --------- Co-authored-by: THOLOT DECHENE Matthieu <matthieu@yuno.malio.fr> Co-authored-by: matthieu <matthieu@yuno.malio.fr> Reviewed-on: #58 Co-authored-by: tristan <tristan@yuno.malio.fr> Co-committed-by: tristan <tristan@yuno.malio.fr>
This commit was merged in pull request #58.
This commit is contained in:
@@ -298,6 +298,41 @@ describe('MalioInputPhone', () => {
|
||||
expect(wrapper.get('input').classes()).toContain('!pr-10')
|
||||
})
|
||||
|
||||
it('shows default add button color when empty and unfocused', () => {
|
||||
const wrapper = mountComponent({addable: true})
|
||||
|
||||
expect(wrapper.get('[data-test="add-button"]').classes()).toContain('text-m-muted')
|
||||
expect(wrapper.get('[data-test="add-button"]').classes()).not.toContain('text-m-primary')
|
||||
})
|
||||
|
||||
it('shows primary add button color on focus', async () => {
|
||||
const wrapper = mountComponent({addable: true})
|
||||
|
||||
await wrapper.get('input').trigger('focus')
|
||||
|
||||
expect(wrapper.get('[data-test="add-button"]').classes()).toContain('text-m-primary')
|
||||
})
|
||||
|
||||
it('shows black add button color when filled and unfocused', () => {
|
||||
const wrapper = mountComponent({addable: true, modelValue: '+33612345678'})
|
||||
|
||||
expect(wrapper.get('[data-test="add-button"]').classes()).toContain('text-black')
|
||||
})
|
||||
|
||||
it('error overrides focus color on add button', async () => {
|
||||
const wrapper = mountComponent({addable: true, error: 'Numéro invalide'})
|
||||
|
||||
await wrapper.get('input').trigger('focus')
|
||||
|
||||
expect(wrapper.get('[data-test="add-button"]').classes()).toContain('text-m-danger')
|
||||
})
|
||||
|
||||
it('success applies to add button', () => {
|
||||
const wrapper = mountComponent({addable: true, success: 'Numéro valide'})
|
||||
|
||||
expect(wrapper.get('[data-test="add-button"]').classes()).toContain('text-m-success')
|
||||
})
|
||||
|
||||
it('applies mask via maska directive', async () => {
|
||||
const wrapper = mountComponent({mask: '+## # ## ## ## ##'})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user