mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
tests for all gdtEntryTypes
This commit is contained in:
parent
25e42683f3
commit
e56ba22dcb
@ -11,26 +11,30 @@ describe('TransactionCollapse', () => {
|
||||
$n: jest.fn((n) => n),
|
||||
}
|
||||
|
||||
const propsData = {
|
||||
amount: 100,
|
||||
gdt: 110,
|
||||
factor: 22,
|
||||
gdtEntryType: 1,
|
||||
}
|
||||
|
||||
const Wrapper = () => {
|
||||
const Wrapper = (propsData) => {
|
||||
return mount(TransactionCollapse, { localVue, mocks, propsData })
|
||||
}
|
||||
|
||||
describe('mount', () => {
|
||||
describe('mount with gdtEntryType: 1', () => {
|
||||
beforeEach(() => {
|
||||
wrapper = Wrapper()
|
||||
const propsData = {
|
||||
amount: 100,
|
||||
gdt: 110,
|
||||
factor: 22,
|
||||
gdtEntryType: 1,
|
||||
}
|
||||
|
||||
wrapper = Wrapper(propsData)
|
||||
})
|
||||
|
||||
it('renders the component', () => {
|
||||
expect(wrapper.find('div.gdt-transaction-collapse').exists()).toBeTruthy()
|
||||
})
|
||||
|
||||
it('checks the prop gdtEntryType ', () => {
|
||||
expect(wrapper.props().gdtEntryType).toBe(1)
|
||||
})
|
||||
|
||||
it('renders the component clooaps-header', () => {
|
||||
expect(wrapper.find('.gdt-list-clooaps-header-text')).toBeTruthy()
|
||||
})
|
||||
@ -54,9 +58,95 @@ describe('TransactionCollapse', () => {
|
||||
it('renders the component clooaps-secondMath', () => {
|
||||
expect(wrapper.find('#clooaps-secondMath').text()).toBe('100 € * 22 GDT / € = 110 GDT')
|
||||
})
|
||||
})
|
||||
|
||||
describe('mount with gdtEntryType: 7', () => {
|
||||
beforeEach(() => {
|
||||
const propsData = {
|
||||
amount: 100,
|
||||
gdt: 2200,
|
||||
factor: 22,
|
||||
gdtEntryType: 7,
|
||||
}
|
||||
|
||||
wrapper = Wrapper(propsData)
|
||||
})
|
||||
|
||||
it('renders the component', () => {
|
||||
expect(wrapper.find('div.gdt-transaction-collapse').exists()).toBeTruthy()
|
||||
})
|
||||
|
||||
it('checks the prop gdtEntryType ', () => {
|
||||
expect(wrapper.props().gdtEntryType).toBe(1)
|
||||
expect(wrapper.props().gdtEntryType).toBe(7)
|
||||
})
|
||||
|
||||
it('renders the component clooaps-header', () => {
|
||||
expect(wrapper.find('.gdt-list-clooaps-header-text')).toBeTruthy()
|
||||
})
|
||||
|
||||
it('renders the component clooaps-headline', () => {
|
||||
expect(wrapper.find('#clooaps-headline').text()).toBe('gdt.conversion-gdt-euro')
|
||||
})
|
||||
|
||||
it('renders the component clooaps-first', () => {
|
||||
expect(wrapper.find('#clooaps-first').text()).toBe('gdt.raise')
|
||||
})
|
||||
|
||||
it('renders the component clooaps-second', () => {
|
||||
expect(wrapper.find('#clooaps-second').text()).toBe('gdt.conversion')
|
||||
})
|
||||
|
||||
it('renders the component clooaps-firstMath', () => {
|
||||
expect(wrapper.find('#clooaps-firstMath').text()).toBe('2200 %')
|
||||
})
|
||||
|
||||
it('renders the component clooaps-secondMath', () => {
|
||||
expect(wrapper.find('#clooaps-secondMath').text()).toBe('100 GDT * 2200 % = 2200 GDT')
|
||||
})
|
||||
})
|
||||
|
||||
describe('mount with gdtEntryType: 4', () => {
|
||||
beforeEach(() => {
|
||||
const propsData = {
|
||||
amount: 100,
|
||||
gdt: 2200,
|
||||
factor: 22,
|
||||
gdtEntryType: 4,
|
||||
}
|
||||
|
||||
wrapper = Wrapper(propsData)
|
||||
})
|
||||
|
||||
it('renders the component', () => {
|
||||
expect(wrapper.find('div.gdt-transaction-collapse').exists()).toBeTruthy()
|
||||
})
|
||||
|
||||
it('checks the prop gdtEntryType ', () => {
|
||||
expect(wrapper.props().gdtEntryType).toBe(4)
|
||||
})
|
||||
|
||||
it('renders the component clooaps-header', () => {
|
||||
expect(wrapper.find('.gdt-list-clooaps-header-text')).toBeTruthy()
|
||||
})
|
||||
|
||||
it('renders the component clooaps-headline', () => {
|
||||
expect(wrapper.find('#clooaps-headline').text()).toBe('gdt.publisher')
|
||||
})
|
||||
|
||||
it('renders the component clooaps-first', () => {
|
||||
expect(wrapper.find('#clooaps-first').text()).toBe('')
|
||||
})
|
||||
|
||||
it('renders the component clooaps-second', () => {
|
||||
expect(wrapper.find('#clooaps-second').text()).toBe('')
|
||||
})
|
||||
|
||||
it('renders the component clooaps-firstMath', () => {
|
||||
expect(wrapper.find('#clooaps-firstMath').text()).toBe('')
|
||||
})
|
||||
|
||||
it('renders the component clooaps-secondMath', () => {
|
||||
expect(wrapper.find('#clooaps-secondMath').text()).toBe('')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@ -58,9 +58,9 @@ export default {
|
||||
second: this.$t('gdt.conversion'),
|
||||
secondMath:
|
||||
this.$n(this.amount, 'decimal') +
|
||||
' GDT * ' +
|
||||
' GDT * ' +
|
||||
this.factor * 100 +
|
||||
'% = ' +
|
||||
' % = ' +
|
||||
this.$n(this.gdt, 'decimal') +
|
||||
' GDT',
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user