From 7cc4d8e5e2ebb01a1e01afc5683f1ee81c00acb6 Mon Sep 17 00:00:00 2001 From: ogerly Date: Wed, 17 Nov 2021 16:21:23 +0100 Subject: [PATCH] =?UTF-8?q?adminbereich,=20=C3=BCbersicht,=20usersuche,=20?= =?UTF-8?q?sch=C3=B6pfen,=20sch=C3=B6pfung=20best=C3=A4tigen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/src/components/CreateFormular.vue | 66 ------- admin/src/components/CreationFormular.spec.js | 22 +++ admin/src/components/CreationFormular.vue | 114 ++++++++++++ admin/src/components/NavBar.spec.js | 22 +++ admin/src/components/NavBar.vue | 27 ++- admin/src/components/UserTable.spec.js | 22 +++ admin/src/components/UserTable.vue | 133 ++++++++------ admin/src/locales/en.json | 17 +- admin/src/main.js | 6 +- admin/src/main.test.js | 25 +++ admin/src/router/routes.js | 7 + admin/src/views/Creation.vue | 171 +++++++++++++++++- admin/src/views/CreationConfirm.vue | 108 +++++++++++ admin/src/views/Overview.vue | 73 ++++++-- admin/src/views/UserSearch.vue | 74 +++++++- 15 files changed, 710 insertions(+), 177 deletions(-) delete mode 100644 admin/src/components/CreateFormular.vue create mode 100644 admin/src/components/CreationFormular.spec.js create mode 100644 admin/src/components/CreationFormular.vue create mode 100644 admin/src/components/NavBar.spec.js create mode 100644 admin/src/components/UserTable.spec.js create mode 100644 admin/src/views/CreationConfirm.vue diff --git a/admin/src/components/CreateFormular.vue b/admin/src/components/CreateFormular.vue deleted file mode 100644 index 5dd07a4c1..000000000 --- a/admin/src/components/CreateFormular.vue +++ /dev/null @@ -1,66 +0,0 @@ - - diff --git a/admin/src/components/CreationFormular.spec.js b/admin/src/components/CreationFormular.spec.js new file mode 100644 index 000000000..c2098768c --- /dev/null +++ b/admin/src/components/CreationFormular.spec.js @@ -0,0 +1,22 @@ +import { mount } from '@vue/test-utils' +import CreationFormular from './CreationFormular.vue' + +const localVue = global.localVue + +describe('CreationFormular', () => { + let wrapper + + const Wrapper = () => { + return mount(CreationFormular, { localVue }) + } + + describe('mount', () => { + beforeEach(() => { + wrapper = Wrapper() + }) + + it('have a DIV element with the class.componente-creation-formular', () => { + expect(wrapper.find('.componente-creation-formular').exists()).toBeTruthy() + }) + }) +}) diff --git a/admin/src/components/CreationFormular.vue b/admin/src/components/CreationFormular.vue new file mode 100644 index 000000000..dbc40c13c --- /dev/null +++ b/admin/src/components/CreationFormular.vue @@ -0,0 +1,114 @@ + + diff --git a/admin/src/components/NavBar.spec.js b/admin/src/components/NavBar.spec.js new file mode 100644 index 000000000..ab9be26e5 --- /dev/null +++ b/admin/src/components/NavBar.spec.js @@ -0,0 +1,22 @@ +import { mount } from '@vue/test-utils' +import NavBar from './NavBar.vue' + +const localVue = global.localVue + +describe('NavBar', () => { + let wrapper + + const Wrapper = () => { + return mount(NavBar, { localVue }) + } + + describe('mount', () => { + beforeEach(() => { + wrapper = Wrapper() + }) + + it('have a DIV element with the class.componente-nabvar', () => { + expect(wrapper.find('.componente-nabvar').exists()).toBeTruthy() + }) + }) +}) diff --git a/admin/src/components/NavBar.vue b/admin/src/components/NavBar.vue index 42bc2161c..1efdffc04 100644 --- a/admin/src/components/NavBar.vue +++ b/admin/src/components/NavBar.vue @@ -1,19 +1,18 @@ diff --git a/admin/src/components/UserTable.spec.js b/admin/src/components/UserTable.spec.js new file mode 100644 index 000000000..935bd177c --- /dev/null +++ b/admin/src/components/UserTable.spec.js @@ -0,0 +1,22 @@ +import { mount } from '@vue/test-utils' +import UserTable from './UserTable.vue' + +const localVue = global.localVue + +describe('UserTable', () => { + let wrapper + + const Wrapper = () => { + return mount(UserTable, { localVue }) + } + + describe('mount', () => { + beforeEach(() => { + wrapper = Wrapper() + }) + + it('have a DIV element with the class.componente-user-table', () => { + expect(wrapper.find('.componente-user-table').exists()).toBeTruthy() + }) + }) +}) diff --git a/admin/src/components/UserTable.vue b/admin/src/components/UserTable.vue index 2e92c9a7f..a376e0f67 100644 --- a/admin/src/components/UserTable.vue +++ b/admin/src/components/UserTable.vue @@ -1,24 +1,8 @@ diff --git a/admin/src/locales/en.json b/admin/src/locales/en.json index ac7159ece..0967ef424 100644 --- a/admin/src/locales/en.json +++ b/admin/src/locales/en.json @@ -1,16 +1 @@ -{ - "monthNames": { - "January": "", - "February": "", - "March": "", - "April": "", - "May": "", - "June": "", - "July": "", - "August": "", - "September": "", - "October": "", - "November": "", - "December": "" - } -} +{} diff --git a/admin/src/main.js b/admin/src/main.js index 197b82888..b3925c9fe 100644 --- a/admin/src/main.js +++ b/admin/src/main.js @@ -13,9 +13,9 @@ import VueApollo from 'vue-apollo' import CONFIG from './config' -import { BootstrapVue } from 'bootstrap-vue' -import 'bootstrap-vue/dist/bootstrap-vue.css' +import { BootstrapVue, IconsPlugin } from 'bootstrap-vue' import 'bootstrap/dist/css/bootstrap.css' +import 'bootstrap-vue/dist/bootstrap-vue.css' import moment from 'vue-moment' @@ -52,6 +52,8 @@ const apolloProvider = new VueApollo({ }) Vue.use(BootstrapVue) +Vue.use(IconsPlugin) + Vue.use(moment) addNavigationGuards(router, store) diff --git a/admin/src/main.test.js b/admin/src/main.test.js index 27c8898ab..b2d7fadc8 100644 --- a/admin/src/main.test.js +++ b/admin/src/main.test.js @@ -5,10 +5,13 @@ import CONFIG from './config' import Vue from 'vue' import Vuex from 'vuex' import VueI18n from 'vue-i18n' +import { BootstrapVue, IconsPlugin } from 'bootstrap-vue' +import moment from 'vue-moment' jest.mock('vue') jest.mock('vuex') jest.mock('vue-i18n') +jest.mock('moment') const storeMock = jest.fn() Vuex.Store = storeMock @@ -25,6 +28,16 @@ jest.mock('apollo-boost', () => { } }) +jest.mock('bootstrap-vue', () => { + return { + __esModule: true, + BootstrapVue: jest.fn(), + IconsPlugin: jest.fn(() => { + return { concat: jest.fn() } + }), + } +}) + describe('main', () => { it('calls the HttpLink', () => { expect(HttpLink).toBeCalledWith({ uri: CONFIG.GRAPHQL_URI }) @@ -50,6 +63,18 @@ describe('main', () => { expect(VueI18n).toBeCalled() }) + it('calls BootstrapVue', () => { + expect(BootstrapVue).toBeCalled() + }) + + it('calls IconsPlugin', () => { + expect(IconsPlugin).toBeCalled() + }) + + it('calls Moment', () => { + expect(moment).toBeCalled() + }) + it.skip('creates a store', () => { expect(storeMock).toBeCalled() }) diff --git a/admin/src/router/routes.js b/admin/src/router/routes.js index 71500eece..a13463e08 100644 --- a/admin/src/router/routes.js +++ b/admin/src/router/routes.js @@ -27,6 +27,13 @@ const routes = [ requiresAuth: true, }, }, + { + path: '/creation-confirm', + component: () => import('@/views/CreationConfirm.vue'), + meta: { + requiresAuth: true, + }, + }, { path: '*', component: () => import('@/components/NotFoundPage.vue'), diff --git a/admin/src/views/Creation.vue b/admin/src/views/Creation.vue index 794218163..02a060f74 100644 --- a/admin/src/views/Creation.vue +++ b/admin/src/views/Creation.vue @@ -1,9 +1,178 @@ + diff --git a/admin/src/views/CreationConfirm.vue b/admin/src/views/CreationConfirm.vue new file mode 100644 index 000000000..2d416e08f --- /dev/null +++ b/admin/src/views/CreationConfirm.vue @@ -0,0 +1,108 @@ + + diff --git a/admin/src/views/Overview.vue b/admin/src/views/Overview.vue index 55eca4aea..d529701e2 100644 --- a/admin/src/views/Overview.vue +++ b/admin/src/views/Overview.vue @@ -1,26 +1,71 @@ diff --git a/admin/src/views/UserSearch.vue b/admin/src/views/UserSearch.vue index be6ce38c9..c7ed5ffef 100644 --- a/admin/src/views/UserSearch.vue +++ b/admin/src/views/UserSearch.vue @@ -1,9 +1,73 @@ +