| 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: admin malio <malio@yuno.malio.fr> Co-authored-by: THOLOT DECHENE Matthieu <matthieu@yuno.malio.fr> Reviewed-on: #91 Co-authored-by: tristan <tristan@yuno.malio.fr> Co-committed-by: tristan <tristan@yuno.malio.fr>
This commit was merged in pull request #91.
This commit is contained in:
@@ -7,6 +7,7 @@ type Option = {
|
||||
label: string
|
||||
value: string | number
|
||||
color?: string
|
||||
textColor?: string
|
||||
}
|
||||
|
||||
type SelectCheckboxProps = {
|
||||
@@ -441,4 +442,23 @@ describe('MalioSelectCheckbox', () => {
|
||||
expect(tag.classes()).toContain('bg-m-bg')
|
||||
expect(tag.attributes('style')).toBeFalsy()
|
||||
})
|
||||
|
||||
it('applique la couleur de texte fournie par l’option', () => {
|
||||
const wrapper = mount(SelectCheckboxForTest, {
|
||||
props: {modelValue: ['fr'], options: [{label: 'France', value: 'fr', textColor: '#ffffff'}], displayTag: true},
|
||||
})
|
||||
|
||||
const tag = wrapper.findAll('span.inline-flex')[0]
|
||||
expect(tag.attributes('style')).toContain('color')
|
||||
})
|
||||
|
||||
it('n’applique pas la couleur de texte custom en disabled (reste grisé)', () => {
|
||||
const wrapper = mount(SelectCheckboxForTest, {
|
||||
props: {modelValue: ['fr'], options: [{label: 'France', value: 'fr', textColor: '#ffffff'}], displayTag: true, disabled: true},
|
||||
})
|
||||
|
||||
const tag = wrapper.findAll('span.inline-flex')[0]
|
||||
expect(tag.classes()).toContain('text-black/60')
|
||||
expect(tag.attributes('style') ?? '').not.toContain('color')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user