Merge last branch in this.

This commit is contained in:
elweyn 2021-12-01 09:33:26 +01:00
commit 83af3bc692
5 changed files with 25 additions and 21 deletions

View File

@ -441,7 +441,7 @@ jobs:
report_name: Coverage Admin Interface report_name: Coverage Admin Interface
type: lcov type: lcov
result_path: ./coverage/lcov.info result_path: ./coverage/lcov.info
min_coverage: 53 min_coverage: 51
token: ${{ github.token }} token: ${{ github.token }}
############################################################################## ##############################################################################

View File

@ -234,17 +234,9 @@ export default {
// lösche alle Mitglieder aus der MehrfachSchöpfungsListe nach dem alle Mehrfachschpfungen zum bestätigen gesendet wurden. // lösche alle Mitglieder aus der MehrfachSchöpfungsListe nach dem alle Mehrfachschpfungen zum bestätigen gesendet wurden.
this.$emit('remove-all-bookmark') this.$emit('remove-all-bookmark')
} else if (this.type === 'singleCreation') { } else if (this.type === 'singleCreation') {
this.submitObj = {
email: this.item.email,
creationDate: this.radioSelected.long,
amount: Number(this.value),
memo: this.text,
moderator: Number(this.$store.state.moderator.id),
}
this.$apollo this.$apollo
.query({ .mutate({
query: createPendingCreation, mutation: createPendingCreation,
variables: this.submitObj, variables: this.submitObj,
}) })
.then((result) => { .then((result) => {

View File

@ -1,11 +1,17 @@
import gql from 'graphql-tag' import gql from 'graphql-tag'
export const createPendingCreation = gql` export const createPendingCreation = gql`
query ($email: String!, $amount: Int!, $note: String!, $creationDate: String!, $moderator: Int!) { mutation (
$email: String!
$amount: Int!
$memo: String!
$creationDate: String!
$moderator: Int!
) {
createPendingCreation( createPendingCreation(
email: $email email: $email
amount: $amount amount: $amount
note: $note memo: $memo
creationDate: $creationDate creationDate: $creationDate
moderator: $moderator moderator: $moderator
) )

View File

@ -3,12 +3,14 @@ import './main'
import CONFIG from './config' import CONFIG from './config'
import Vue from 'vue' import Vue from 'vue'
import VueApollo from 'vue-apollo'
import Vuex from 'vuex' import Vuex from 'vuex'
import VueI18n from 'vue-i18n' import VueI18n from 'vue-i18n'
import { BootstrapVue, IconsPlugin } from 'bootstrap-vue' import { BootstrapVue, IconsPlugin } from 'bootstrap-vue'
import moment from 'vue-moment' import moment from 'vue-moment'
jest.mock('vue') jest.mock('vue')
jest.mock('vue-apollo')
jest.mock('vuex') jest.mock('vuex')
jest.mock('vue-i18n') jest.mock('vue-i18n')
jest.mock('vue-moment') jest.mock('vue-moment')
@ -55,6 +57,10 @@ describe('main', () => {
expect(InMemoryCache).toBeCalled() expect(InMemoryCache).toBeCalled()
}) })
it('calls the VueApollo', () => {
expect(VueApollo).toBeCalled()
})
it('calls Vue', () => { it('calls Vue', () => {
expect(Vue).toBeCalled() expect(Vue).toBeCalled()
}) })
@ -63,16 +69,16 @@ describe('main', () => {
expect(VueI18n).toBeCalled() expect(VueI18n).toBeCalled()
}) })
it.skip('calls BootstrapVue', () => { it('calls BootstrapVue', () => {
expect(BootstrapVue).toBeCalled() expect(Vue.use).toBeCalledWith(BootstrapVue)
}) })
it.skip('calls IconsPlugin', () => { it('calls IconsPlugin', () => {
expect(IconsPlugin).toBeCalled() expect(Vue.use).toBeCalledWith(IconsPlugin)
}) })
it.skip('calls Moment', () => { it('calls Moment', () => {
expect(moment).toBeCalled() expect(Vue.use).toBeCalledWith(moment)
}) })
it.skip('creates a store', () => { it.skip('creates a store', () => {

View File

@ -1,4 +1,4 @@
import { Resolver, Query, Arg, Args, Authorized } from 'type-graphql' import { Resolver, Query, Arg, Args, Authorized, Mutation } from 'type-graphql'
import { getCustomRepository, Raw } from 'typeorm' import { getCustomRepository, Raw } from 'typeorm'
import { UserAdmin } from '../model/UserAdmin' import { UserAdmin } from '../model/UserAdmin'
import { PendingCreation } from '../model/PendingCreation' import { PendingCreation } from '../model/PendingCreation'
@ -30,7 +30,7 @@ export class AdminResolver {
return adminUsers return adminUsers
} }
@Query(() => [Number]) @Mutation(() => [Number])
async createPendingCreation( async createPendingCreation(
@Args() { email, amount, memo, creationDate, moderator }: CreatePendingCreationArgs, @Args() { email, amount, memo, creationDate, moderator }: CreatePendingCreationArgs,
): Promise<number[]> { ): Promise<number[]> {