more tests

This commit is contained in:
ogerly 2021-09-13 10:43:34 +02:00
parent 28b871f11b
commit 25e42683f3
2 changed files with 25 additions and 13 deletions

View File

@ -15,7 +15,7 @@ describe('TransactionCollapse', () => {
amount: 100, amount: 100,
gdt: 110, gdt: 110,
factor: 22, factor: 22,
gdtEntryType: 4, gdtEntryType: 1,
} }
const Wrapper = () => { const Wrapper = () => {
@ -31,20 +31,32 @@ describe('TransactionCollapse', () => {
expect(wrapper.find('div.gdt-transaction-collapse').exists()).toBeTruthy() expect(wrapper.find('div.gdt-transaction-collapse').exists()).toBeTruthy()
}) })
it('checks the prop amount ', () => { it('renders the component clooaps-header', () => {
expect(wrapper.props().amount).toBe(100) expect(wrapper.find('.gdt-list-clooaps-header-text')).toBeTruthy()
}) })
it('checks the prop gdt ', () => { it('renders the component clooaps-headline', () => {
expect(wrapper.props().gdt).toBe(110) expect(wrapper.find('#clooaps-headline').text()).toBe('gdt.calculation')
}) })
it('checks the prop factor ', () => { it('renders the component clooaps-first', () => {
expect(wrapper.props().factor).toBe(22) expect(wrapper.find('#clooaps-first').text()).toBe('gdt.factor')
})
it('renders the component clooaps-second', () => {
expect(wrapper.find('#clooaps-second').text()).toBe('gdt.formula')
})
it('renders the component clooaps-firstMath', () => {
expect(wrapper.find('#clooaps-firstMath').text()).toBe('22 GDT pro €')
})
it('renders the component clooaps-secondMath', () => {
expect(wrapper.find('#clooaps-secondMath').text()).toBe('100 € * 22 GDT / € = 110 GDT')
}) })
it('checks the prop gdtEntryType ', () => { it('checks the prop gdtEntryType ', () => {
expect(wrapper.props().gdtEntryType).toBe(4) expect(wrapper.props().gdtEntryType).toBe(1)
}) })
}) })
}) })

View File

@ -1,18 +1,18 @@
<template> <template>
<div class="gdt-transaction-collapse"> <div class="gdt-transaction-collapse">
<b-row class="gdt-list-clooaps-header-text text-center pb-3"> <b-row class="gdt-list-clooaps-header-text text-center pb-3">
<div class="col h4"> <div id="clooaps-headline" class="col h4">
{{ getLinesByType(gdtEntryType).headline }} {{ getLinesByType(gdtEntryType).headline }}
</div> </div>
</b-row> </b-row>
<b-row class="gdt-list-clooaps-box--all"> <b-row class="gdt-list-clooaps-box--all">
<div class="col-6 text-right clooaps-col-left"> <div class="col-6 text-right clooaps-col-left">
<div>{{ getLinesByType(gdtEntryType).first }}</div> <div id="clooaps-first">{{ getLinesByType(gdtEntryType).first }}</div>
<div>{{ getLinesByType(gdtEntryType).second }}</div> <div id="clooaps-second">{{ getLinesByType(gdtEntryType).second }}</div>
</div> </div>
<div class="col-6 clooaps-col-right"> <div class="col-6 clooaps-col-right">
<div>{{ getLinesByType(gdtEntryType).firstMath }}</div> <div id="clooaps-firstMath">{{ getLinesByType(gdtEntryType).firstMath }}</div>
<div> <div id="clooaps-secondMath">
{{ getLinesByType(gdtEntryType).secondMath }} {{ getLinesByType(gdtEntryType).secondMath }}
</div> </div>
</div> </div>