mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Change reset button to cancel and add tests
This commit is contained in:
parent
704eec7c17
commit
91538b72de
@ -45,8 +45,70 @@ describe('ContributionForm', () => {
|
|||||||
expect(wrapper.find('div.contribution-form').exists()).toBe(true)
|
expect(wrapper.find('div.contribution-form').exists()).toBe(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('is submit button disable of true', () => {
|
describe('empty form data', () => {
|
||||||
expect(wrapper.find('button[type="submit"]').attributes('disabled')).toBe('disabled')
|
describe('has button', () => {
|
||||||
|
it('reset enabled', () => {
|
||||||
|
expect(wrapper.find('button[type="reset"]').attributes('disabled')).toBeFalsy()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('submit disabled', () => {
|
||||||
|
expect(wrapper.find('button[type="submit"]').attributes('disabled')).toBe('disabled')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('set contrubtion', () => {
|
||||||
|
describe('fill in form data', () => {
|
||||||
|
const now = new Date().toISOString()
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await wrapper.setData({
|
||||||
|
form: {
|
||||||
|
id: null,
|
||||||
|
date: now,
|
||||||
|
memo: 'Mein Beitrag zur Gemeinschaft für diesen Monat ...',
|
||||||
|
amount: '200',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('has button', () => {
|
||||||
|
it('reset enabled', () => {
|
||||||
|
expect(wrapper.find('button[type="reset"]').attributes('disabled')).toBeFalsy()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('submit enabled', () => {
|
||||||
|
expect(wrapper.find('button[type="submit"]').attributes('disabled')).toBeFalsy()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('update contrubtion', () => {
|
||||||
|
describe('fill in form data and "id"', () => {
|
||||||
|
const now = new Date().toISOString()
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await wrapper.setData({
|
||||||
|
form: {
|
||||||
|
id: 2,
|
||||||
|
date: now,
|
||||||
|
memo: 'Mein Beitrag zur Gemeinschaft für diesen Monat ...',
|
||||||
|
amount: '200',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('has button', () => {
|
||||||
|
it('reset enabled', () => {
|
||||||
|
expect(wrapper.find('button[type="reset"]').attributes('disabled')).toBeFalsy()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('submit enabled', () => {
|
||||||
|
expect(wrapper.find('button[type="submit"]').attributes('disabled')).toBeFalsy()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -71,8 +71,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<b-row class="mt-3">
|
<b-row class="mt-3">
|
||||||
<b-col>
|
<b-col>
|
||||||
<b-button type="button" variant="light" @click.prevent="reset">
|
<b-button class="test-cancel" type="reset" variant="secondary" @click="reset">
|
||||||
{{ $t('form.reset') }}
|
{{ $t('form.cancel') }}
|
||||||
</b-button>
|
</b-button>
|
||||||
</b-col>
|
</b-col>
|
||||||
<b-col class="text-right">
|
<b-col class="text-right">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user