mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
test first example
This commit is contained in:
parent
f4729e4984
commit
07dc5cf5d4
@ -9,7 +9,6 @@
|
||||
<b-form-datepicker
|
||||
id="contribution-date"
|
||||
v-model="form.date"
|
||||
size="lg"
|
||||
:locale="$i18n.locale"
|
||||
:max="maximalDate"
|
||||
:min="minimalDate"
|
||||
@ -22,40 +21,39 @@
|
||||
<template #nav-prev-year><span></span></template>
|
||||
<template #nav-next-year><span></span></template>
|
||||
</b-form-datepicker>
|
||||
<div v-if="validMaxGDD > 0">
|
||||
<input-textarea
|
||||
id="contribution-memo"
|
||||
v-model="form.memo"
|
||||
:name="$t('form.message')"
|
||||
:label="$t('contribution.activity')"
|
||||
:placeholder="$t('contribution.yourActivity')"
|
||||
:rules="{ required: true, min: 5, max: 255 }"
|
||||
/>
|
||||
<input-hour
|
||||
v-model="form.hours"
|
||||
:name="$t('form.hours')"
|
||||
:label="$t('form.hours')"
|
||||
placeholder="0.5"
|
||||
:rules="{
|
||||
required: true,
|
||||
min: 0.5,
|
||||
max: validMaxTime,
|
||||
gddCreationTime: [0.5, validMaxTime],
|
||||
}"
|
||||
:validMaxTime="validMaxTime"
|
||||
@updateAmount="updateAmount"
|
||||
></input-hour>
|
||||
<input-amount
|
||||
id="contribution-amount"
|
||||
v-model="form.amount"
|
||||
:name="$t('form.amount')"
|
||||
:label="$t('form.amount')"
|
||||
placeholder="20"
|
||||
:rules="{ required: true, gddSendAmount: [20, validMaxGDD] }"
|
||||
typ="ContributionForm"
|
||||
></input-amount>
|
||||
</div>
|
||||
<div v-else class="mb-5">{{ $t('contribution.exhausted') }}</div>
|
||||
|
||||
<input-textarea
|
||||
id="contribution-memo"
|
||||
v-model="form.memo"
|
||||
:name="$t('form.message')"
|
||||
:label="$t('contribution.activity')"
|
||||
:placeholder="$t('contribution.yourActivity')"
|
||||
:rules="{ required: true, min: 5, max: 255 }"
|
||||
/>
|
||||
<input-hour
|
||||
v-model="form.hours"
|
||||
:name="$t('form.hours')"
|
||||
:label="$t('form.hours')"
|
||||
placeholder="0.5"
|
||||
:rules="{
|
||||
required: true,
|
||||
min: 0.5,
|
||||
max: validMaxTime,
|
||||
gddCreationTime: [0.5, validMaxTime],
|
||||
}"
|
||||
:validMaxTime="validMaxTime"
|
||||
@updateAmount="updateAmount"
|
||||
></input-hour>
|
||||
<input-amount
|
||||
id="contribution-amount"
|
||||
v-model="form.amount"
|
||||
:name="$t('form.amount')"
|
||||
:label="$t('form.amount')"
|
||||
placeholder="20"
|
||||
:rules="{ required: true, gddSendAmount: [20, validMaxGDD] }"
|
||||
typ="ContributionForm"
|
||||
></input-amount>
|
||||
|
||||
<b-row class="mt-5">
|
||||
<b-col>
|
||||
<b-button type="reset" variant="secondary" @click="reset" data-test="button-cancel">
|
||||
|
||||
@ -50,7 +50,7 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
currentValue() {
|
||||
this.$emit('input', this.currentValue)
|
||||
this.$emit('input', isNaN(Number(this.currentValue)) ? 0 : Number(this.currentValue))
|
||||
},
|
||||
value() {
|
||||
if (this.value !== this.currentValue) this.currentValue = this.value
|
||||
|
||||
@ -284,15 +284,6 @@ describe('Community', () => {
|
||||
it('verifies the login (to get the new creations available)', () => {
|
||||
expect(apolloRefetchMock).toBeCalled()
|
||||
})
|
||||
|
||||
it('set all data to the default values)', () => {
|
||||
const now = new Date().toISOString().split('T')[0]
|
||||
|
||||
expect(wrapper.vm.form.id).toBe(null)
|
||||
expect(wrapper.vm.form.date.text()).toContain(now)
|
||||
expect(wrapper.vm.form.memo).toBe('')
|
||||
expect(wrapper.vm.form.amount).toBe('')
|
||||
})
|
||||
})
|
||||
|
||||
describe('with error', () => {
|
||||
|
||||
@ -56,7 +56,6 @@ export const loadAllRules = (i18nCallback) => {
|
||||
|
||||
extend('gddCreationTime', {
|
||||
validate(value, { min, max }) {
|
||||
if (value) value = value.replace(',', '.')
|
||||
return value >= min && value <= max
|
||||
},
|
||||
params: ['min', 'max'],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user