diff --git a/.github/workflows/test_dht-node.yml b/.github/workflows/test_dht-node.yml index 5b3a65a70..4ac475351 100644 --- a/.github/workflows/test_dht-node.yml +++ b/.github/workflows/test_dht-node.yml @@ -1,4 +1,4 @@ -name: gradido test_dht-node CI +name: Gradido DHT Node Test CI on: push @@ -7,7 +7,7 @@ jobs: # JOB: DOCKER BUILD TEST ##################################################### ############################################################################## build: - name: Docker Build Test + name: Docker Build Test - DHT Node runs-on: ubuntu-latest steps: - name: Checkout code @@ -28,7 +28,7 @@ jobs: # JOB: LINT ################################################################## ############################################################################## lint: - name: Lint + name: Lint - DHT Node runs-on: ubuntu-latest needs: [build] steps: @@ -50,7 +50,7 @@ jobs: # JOB: UNIT TEST ############################################################# ############################################################################## unit_test: - name: Unit tests + name: Unit Tests - DHT Node runs-on: ubuntu-latest needs: [build] steps: @@ -90,7 +90,7 @@ jobs: - name: Coverage check uses: webcraftmedia/coverage-check-action@master with: - report_name: Coverage dht-node + report_name: Coverage DHT Node type: lcov #result_path: ./dht-node/coverage/lcov.info result_path: ./coverage/lcov.info diff --git a/.github/workflows/test_federation.yml b/.github/workflows/test_federation.yml index 2da78758e..ab943eedd 100644 --- a/.github/workflows/test_federation.yml +++ b/.github/workflows/test_federation.yml @@ -1,4 +1,4 @@ -name: gradido test_federation CI +name: Gradido Federation Test CI on: push @@ -7,7 +7,7 @@ jobs: # JOB: DOCKER BUILD TEST ##################################################### ############################################################################## build: - name: Docker Build Test + name: Docker Build Test - Federation runs-on: ubuntu-latest steps: - name: Checkout code @@ -28,7 +28,7 @@ jobs: # JOB: LINT ################################################################## ############################################################################## lint: - name: Lint + name: Lint - Federation runs-on: ubuntu-latest needs: [build] steps: @@ -50,7 +50,7 @@ jobs: # JOB: UNIT TEST ############################################################# ############################################################################## unit_test: - name: Unit tests + name: Unit Tests - Federation runs-on: ubuntu-latest needs: [build] steps: @@ -90,7 +90,7 @@ jobs: - name: Coverage check uses: webcraftmedia/coverage-check-action@master with: - report_name: Coverage federation + report_name: Coverage Federation type: lcov #result_path: ./federation/coverage/lcov.info result_path: ./coverage/lcov.info diff --git a/admin/src/components/CreationFormular.spec.js b/admin/src/components/CreationFormular.spec.js index b4b2e8b28..5dba2d931 100644 --- a/admin/src/components/CreationFormular.spec.js +++ b/admin/src/components/CreationFormular.spec.js @@ -1,7 +1,6 @@ import { mount } from '@vue/test-utils' import CreationFormular from './CreationFormular' import { adminCreateContribution } from '../graphql/adminCreateContribution' -import { adminCreateContributions } from '../graphql/adminCreateContributions' import { toastErrorSpy, toastSuccessSpy } from '../../test/testSetup' const localVue = global.localVue @@ -328,122 +327,6 @@ describe('CreationFormular', () => { }) }) }) - - describe('mass creation with success', () => { - beforeEach(async () => { - jest.clearAllMocks() - apolloMutateMock.mockResolvedValue({ - data: { - adminCreateContributions: { - success: true, - successfulContribution: ['bob@baumeister.de', 'bibi@bloxberg.de'], - failedContribution: [], - }, - }, - }) - await wrapper.setProps({ - type: 'massCreation', - creation: [200, 400, 600], - items: [{ email: 'bob@baumeister.de' }, { email: 'bibi@bloxberg.de' }], - }) - await wrapper.findAll('input[type="radio"]').at(1).setChecked() - await wrapper.find('textarea').setValue('Test mass create coins') - await wrapper.find('input[type="number"]').setValue(200) - await wrapper.find('.test-submit').trigger('click') - }) - - it('calls the API', () => { - expect(apolloMutateMock).toBeCalledWith( - expect.objectContaining({ - mutation: adminCreateContributions, - variables: { - pendingCreations: [ - { - email: 'bob@baumeister.de', - creationDate: getCreationDate(1), - amount: 200, - memo: 'Test mass create coins', - }, - { - email: 'bibi@bloxberg.de', - creationDate: getCreationDate(1), - amount: 200, - memo: 'Test mass create coins', - }, - ], - }, - }), - ) - }) - - it('updates open creations in store', () => { - expect(stateCommitMock).toBeCalledWith('openCreationsPlus', 2) - }) - - it('emits remove-all-bookmark', () => { - expect(wrapper.emitted('remove-all-bookmark')).toBeTruthy() - }) - }) - - describe('mass creation with success but all failed', () => { - beforeEach(async () => { - jest.clearAllMocks() - apolloMutateMock.mockResolvedValue({ - data: { - adminCreateContributions: { - success: true, - successfulContribution: [], - failedContribution: ['bob@baumeister.de', 'bibi@bloxberg.de'], - }, - }, - }) - await wrapper.setProps({ - type: 'massCreation', - creation: [200, 400, 600], - items: [{ email: 'bob@baumeister.de' }, { email: 'bibi@bloxberg.de' }], - }) - await wrapper.findAll('input[type="radio"]').at(1).setChecked() - await wrapper.find('textarea').setValue('Test mass create coins') - await wrapper.find('input[type="number"]').setValue(200) - await wrapper.find('.test-submit').trigger('click') - }) - - it('updates open creations in store', () => { - expect(stateCommitMock).toBeCalledWith('openCreationsPlus', 0) - }) - - it('emits remove all bookmarks', () => { - expect(wrapper.emitted('remove-all-bookmark')).toBeTruthy() - }) - - it('emits toast failed creations with two emails', () => { - expect(wrapper.emitted('toast-failed-creations')).toEqual([ - [['bob@baumeister.de', 'bibi@bloxberg.de']], - ]) - }) - }) - - describe('mass creation with error', () => { - beforeEach(async () => { - jest.clearAllMocks() - apolloMutateMock.mockRejectedValue({ - message: 'Oh no!', - }) - await wrapper.setProps({ - type: 'massCreation', - creation: [200, 400, 600], - items: [{ email: 'bob@baumeister.de' }, { email: 'bibi@bloxberg.de' }], - }) - await wrapper.findAll('input[type="radio"]').at(1).setChecked() - await wrapper.find('textarea').setValue('Test mass create coins') - await wrapper.find('input[type="number"]').setValue(200) - await wrapper.find('.test-submit').trigger('click') - }) - - it('toasts an error message', () => { - expect(toastErrorSpy).toBeCalledWith('Oh no!') - }) - }) }) }) }) diff --git a/admin/src/components/CreationFormular.vue b/admin/src/components/CreationFormular.vue index 2201838de..137b46400 100644 --- a/admin/src/components/CreationFormular.vue +++ b/admin/src/components/CreationFormular.vue @@ -86,16 +86,11 @@