test fix for GdtAmount.vue

This commit is contained in:
ogerly 2022-12-23 10:13:16 +01:00
parent 3c3a1f89ad
commit 6d3756652f
2 changed files with 44 additions and 1 deletions

View File

@ -0,0 +1,43 @@
import { mount } from '@vue/test-utils'
import GdtAmount from './GdtAmount'
const localVue = global.localVue
const state = {
language: 'en',
}
const mocks = {
$store: {
state,
},
$i18n: {
locale: 'en',
},
$t: jest.fn((t) => t),
$n: jest.fn((n) => n),
}
const propsData = {
path: 'string',
GdtBalance: 123.45,
badgeShow: false,
showStatus: false,
}
describe('GdtAmount', () => {
let wrapper
const Wrapper = () => {
return mount(GdtAmount, { localVue, mocks, propsData })
}
describe('mount', () => {
beforeEach(() => {
wrapper = Wrapper()
})
it('renders the component gdt-amount', () => {
expect(wrapper.find('div.gdt-amount').exists()).toBe(true)
})
})
})

View File

@ -1,6 +1,6 @@
<template>
<div>
<div class="text-center">
<div class="gdt-amount text-center">
<b-badge
v-if="badgeShow"
class="position-absolute mt--2 ml--4 px-3 zindex1"