Merge pull request #3504 from gradido/frontend_fix_password_labels

fix(frontend):  fix password labels
This commit is contained in:
einhornimmond 2025-06-10 19:58:21 +02:00 committed by GitHub
commit 657862048e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 4 deletions

View File

@ -80,7 +80,7 @@ describe('InputPassword', () => {
})
it('has the placeholder "input-field-placeholder"', () => {
expect(wrapper.find('input').attributes('placeholder')).toEqual('form.password')
expect(wrapper.find('input').attributes('placeholder')).toEqual('input-field-placeholder')
})
it('has the value ""', () => {
@ -88,7 +88,7 @@ describe('InputPassword', () => {
})
it('has the label "input-field-label"', () => {
expect(wrapper.find('label').text()).toEqual('form.password')
expect(wrapper.find('label').text()).toEqual('input-field-label')
})
it('has the label for "input-field-name-input-field"', () => {

View File

@ -62,6 +62,14 @@ const props = defineProps({
type: Boolean,
default: false,
},
label: {
type: String,
default: null,
},
placeholder: {
type: String,
default: null,
},
})
const name = toRef(props, 'name')
@ -73,8 +81,8 @@ const { value, errorMessage, meta, errors, validate } = useField(name, props.rul
const { t } = useI18n()
const defaultTranslations = computed(() => ({
label: t('form.password'),
placeholder: t('form.password'),
label: props.label || t('form.password'),
placeholder: props.placeholder || t('form.password'),
}))
const showPassword = ref(false)