From b124921d339114db6b212f61b0b0b660cbfb1be9 Mon Sep 17 00:00:00 2001 From: ogerly Date: Mon, 8 Aug 2022 15:02:47 +0200 Subject: [PATCH] add test for CommunityStatistic.vue --- .../src/components/CommunityStatistic.spec.js | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 admin/src/components/CommunityStatistic.spec.js diff --git a/admin/src/components/CommunityStatistic.spec.js b/admin/src/components/CommunityStatistic.spec.js new file mode 100644 index 000000000..ad7ce8f5d --- /dev/null +++ b/admin/src/components/CommunityStatistic.spec.js @@ -0,0 +1,38 @@ +import { mount } from '@vue/test-utils' +import CommunityStatistic from './CommunityStatistic' + +const localVue = global.localVue + +const mocks = { + $t: jest.fn((t) => t), +} + +const propsData = { + value: { + totalUsers: '123', + activeUsers: '100', + deletedUsers: '5', + totalGradidoCreated: '2500', + totalGradidoDecayed: '200', + totalGradidoAvailable: '500', + totalGradidoUnbookedDecayed: '111', + }, +} + +describe('CommunityStatistic', () => { + let wrapper + + const Wrapper = () => { + return mount(CommunityStatistic, { localVue, mocks, propsData }) + } + + describe('mount', () => { + beforeEach(() => { + wrapper = Wrapper() + }) + + it('renders the Div Element ".community-statistic"', () => { + expect(wrapper.find('div.community-statistic').exists()).toBe(true) + }) + }) +})