mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
unit test kontoOverview/GddStatus
This commit is contained in:
parent
bebb937aee
commit
5a17d5aeea
42
frontend/src/views/KontoOverview/GddStatus.spec.js
Normal file
42
frontend/src/views/KontoOverview/GddStatus.spec.js
Normal file
@ -0,0 +1,42 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import GddStatus from './GddStatus'
|
||||
import Vuex from 'vuex'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('GddStatus', () => {
|
||||
let wrapper
|
||||
|
||||
let state = {
|
||||
user: {
|
||||
balance: 1234,
|
||||
balance_gdt: 9876,
|
||||
},
|
||||
}
|
||||
|
||||
let store = new Vuex.Store({
|
||||
state,
|
||||
})
|
||||
|
||||
let mocks = {
|
||||
$n: jest.fn((n) => n),
|
||||
}
|
||||
|
||||
const Wrapper = () => {
|
||||
return mount(GddStatus, { localVue, store, mocks })
|
||||
}
|
||||
|
||||
describe('mount', () => {
|
||||
beforeEach(() => {
|
||||
wrapper = Wrapper()
|
||||
})
|
||||
|
||||
it('it displays the ammount of GDD', () => {
|
||||
expect(wrapper.findAll('div.card-body').at(0).text()).toEqual('1234 GDD')
|
||||
})
|
||||
|
||||
it('it displays the ammount of GDT', () => {
|
||||
expect(wrapper.findAll('div.card-body').at(1).text()).toEqual('9876 GDT')
|
||||
})
|
||||
})
|
||||
})
|
||||
@ -15,6 +15,7 @@ import VueRouter from 'vue-router'
|
||||
import BaseDropdown from '@/components/BaseDropdown.vue'
|
||||
import VueQrcode from 'vue-qrcode'
|
||||
import BaseHeader from '@/components/BaseHeader'
|
||||
import StatsCard from '@/components/Cards/StatsCard.vue'
|
||||
|
||||
import clickOutside from '@/directives/click-ouside.js'
|
||||
|
||||
@ -42,5 +43,6 @@ global.localVue.component('validation-observer', ValidationObserver)
|
||||
global.localVue.component(BaseButton.name, BaseButton)
|
||||
global.localVue.component(BaseDropdown.name, BaseDropdown)
|
||||
global.localVue.component(BaseHeader.name, BaseHeader)
|
||||
global.localVue.component(StatsCard.name, StatsCard)
|
||||
|
||||
global.localVue.directive('click-outside', clickOutside)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user