mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge branch 'master' into 1389-TransactionsTabs-are-not-well-designed
This commit is contained in:
commit
ff00e5e9ae
@ -69,6 +69,7 @@
|
|||||||
"memo": "Nachricht",
|
"memo": "Nachricht",
|
||||||
"message": "Nachricht",
|
"message": "Nachricht",
|
||||||
"new_balance": "Neuer Kontostand nach Bestätigung",
|
"new_balance": "Neuer Kontostand nach Bestätigung",
|
||||||
|
"no_gdd_available": "Du hast keine GDD zum versenden.",
|
||||||
"password": "Passwort",
|
"password": "Passwort",
|
||||||
"passwordRepeat": "Passwort wiederholen",
|
"passwordRepeat": "Passwort wiederholen",
|
||||||
"password_new": "Neues Passwort",
|
"password_new": "Neues Passwort",
|
||||||
|
|||||||
@ -69,6 +69,7 @@
|
|||||||
"memo": "Message",
|
"memo": "Message",
|
||||||
"message": "Message",
|
"message": "Message",
|
||||||
"new_balance": "Account balance after confirmation",
|
"new_balance": "Account balance after confirmation",
|
||||||
|
"no_gdd_available": "You do not have GDD to send.",
|
||||||
"password": "Password",
|
"password": "Password",
|
||||||
"passwordRepeat": "Repeat password",
|
"passwordRepeat": "Repeat password",
|
||||||
"password_new": "New password",
|
"password_new": "New password",
|
||||||
|
|||||||
@ -21,7 +21,7 @@ describe('GddSend', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const propsData = {
|
const propsData = {
|
||||||
balance: 100.0,
|
balance: 0.0,
|
||||||
}
|
}
|
||||||
|
|
||||||
const Wrapper = () => {
|
const Wrapper = () => {
|
||||||
@ -37,7 +37,44 @@ describe('GddSend', () => {
|
|||||||
expect(wrapper.find('div.transaction-form').exists()).toBeTruthy()
|
expect(wrapper.find('div.transaction-form').exists()).toBeTruthy()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('transaction form disable because balance 0,0 GDD', () => {
|
||||||
|
it('has a disabled input field of type email', () => {
|
||||||
|
expect(wrapper.find('#input-group-1').find('input').attributes('disabled')).toBe('disabled')
|
||||||
|
})
|
||||||
|
it('has a disabled input field for amount', () => {
|
||||||
|
expect(wrapper.find('#input-2').find('input').attributes('disabled')).toBe('disabled')
|
||||||
|
})
|
||||||
|
it('has a disabled textarea field ', () => {
|
||||||
|
expect(wrapper.find('#input-3').find('textarea').attributes('disabled')).toBe('disabled')
|
||||||
|
})
|
||||||
|
it('has a message indicating that there are no GDDs to send ', () => {
|
||||||
|
expect(wrapper.find('.text-danger').text()).toBe('form.no_gdd_available')
|
||||||
|
})
|
||||||
|
it('has no reset button and no submit button ', () => {
|
||||||
|
expect(wrapper.find('.test-buttons').exists()).toBeFalsy()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe('transaction form', () => {
|
describe('transaction form', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
wrapper.setProps({ balance: 100.0 })
|
||||||
|
})
|
||||||
|
describe('transaction form show because balance 100,0 GDD', () => {
|
||||||
|
it('has no warning message ', () => {
|
||||||
|
expect(wrapper.find('.text-danger').exists()).toBeFalsy()
|
||||||
|
})
|
||||||
|
it('has a reset button', () => {
|
||||||
|
expect(wrapper.find('.test-buttons').findAll('button').at(0).attributes('type')).toBe(
|
||||||
|
'reset',
|
||||||
|
)
|
||||||
|
})
|
||||||
|
it('has a submit button', () => {
|
||||||
|
expect(wrapper.find('.test-buttons').findAll('button').at(1).attributes('type')).toBe(
|
||||||
|
'submit',
|
||||||
|
)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe('email field', () => {
|
describe('email field', () => {
|
||||||
it('has an input field of type email', () => {
|
it('has an input field of type email', () => {
|
||||||
expect(wrapper.find('#input-group-1').find('input').attributes('type')).toBe('email')
|
expect(wrapper.find('#input-group-1').find('input').attributes('type')).toBe('email')
|
||||||
|
|||||||
@ -41,6 +41,7 @@
|
|||||||
placeholder="E-Mail"
|
placeholder="E-Mail"
|
||||||
style="font-size: large"
|
style="font-size: large"
|
||||||
class="pl-3"
|
class="pl-3"
|
||||||
|
:disabled="isBalanceDisabled"
|
||||||
></b-form-input>
|
></b-form-input>
|
||||||
</b-input-group>
|
</b-input-group>
|
||||||
<b-col v-if="errors">
|
<b-col v-if="errors">
|
||||||
@ -76,6 +77,7 @@
|
|||||||
:placeholder="$n(0.01)"
|
:placeholder="$n(0.01)"
|
||||||
style="font-size: large"
|
style="font-size: large"
|
||||||
class="pl-3"
|
class="pl-3"
|
||||||
|
:disabled="isBalanceDisabled"
|
||||||
></b-form-input>
|
></b-form-input>
|
||||||
</b-input-group>
|
</b-input-group>
|
||||||
<b-col v-if="errors">
|
<b-col v-if="errors">
|
||||||
@ -105,6 +107,7 @@
|
|||||||
v-model="form.memo"
|
v-model="form.memo"
|
||||||
class="pl-3"
|
class="pl-3"
|
||||||
style="font-size: large"
|
style="font-size: large"
|
||||||
|
:disabled="isBalanceDisabled"
|
||||||
></b-form-textarea>
|
></b-form-textarea>
|
||||||
</b-input-group>
|
</b-input-group>
|
||||||
<b-col v-if="errors">
|
<b-col v-if="errors">
|
||||||
@ -114,7 +117,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
<b-row>
|
<div v-if="!!isBalanceDisabled" class="text-danger">
|
||||||
|
{{ $t('form.no_gdd_available') }}
|
||||||
|
</div>
|
||||||
|
<b-row v-else class="test-buttons">
|
||||||
<b-col>
|
<b-col>
|
||||||
<b-button type="reset" variant="secondary" @click="onReset">
|
<b-button type="reset" variant="secondary" @click="onReset">
|
||||||
{{ $t('form.reset') }}
|
{{ $t('form.reset') }}
|
||||||
@ -192,6 +198,11 @@ export default {
|
|||||||
this.form.email = this.form.email.trim()
|
this.form.email = this.form.email.trim()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
isBalanceDisabled() {
|
||||||
|
return this.balance <= 0 ? 'disabled' : false
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user