mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
use router push to navigate to send
This commit is contained in:
parent
f0132593b8
commit
4621ee35d1
@ -3,7 +3,11 @@ import AmountAndNameRow from './AmountAndNameRow'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
const mocks = {}
|
||||
const mocks = {
|
||||
$router: {
|
||||
push: jest.fn(),
|
||||
},
|
||||
}
|
||||
|
||||
const propsData = {
|
||||
amount: '19.99',
|
||||
@ -51,10 +55,17 @@ describe('AmountAndNameRow', () => {
|
||||
expect(wrapper.find('div.gdd-transaction-list-item-name').find('a').exists()).toBe(true)
|
||||
})
|
||||
|
||||
it('links with param email', () => {
|
||||
expect(
|
||||
wrapper.find('div.gdd-transaction-list-item-name').find('a').attributes('href'),
|
||||
).toBe('/send?email=bibi@bloxberg.de')
|
||||
describe('click link', () => {
|
||||
beforeEach(async () => {
|
||||
await wrapper.find('div.gdd-transaction-list-item-name').find('a').trigger('click')
|
||||
})
|
||||
|
||||
it('pushes the rpute with query for email', () => {
|
||||
expect(mocks.$router.push).toBeCalledWith({
|
||||
path: '/send',
|
||||
query: { email: 'bibi@bloxberg.de' },
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@ -12,8 +12,7 @@
|
||||
<div class="gdd-transaction-list-item-name">
|
||||
<b-link
|
||||
v-if="linkedUser && linkedUser.email"
|
||||
:href="`/send?email=${linkedUser.email}`"
|
||||
@click.stop
|
||||
@click.stop="$router.push({ path: '/send', query: { email: `${linkedUser.email}` } })"
|
||||
>
|
||||
{{ itemText }}
|
||||
</b-link>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user