diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index da8521a76..78a7a8074 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -360,6 +360,25 @@ jobs: - name: backend | Lint run: docker run --rm gradido/backend:test yarn run lint + ############################################################################## + # JOB: LOCALES BACKEND ####################################################### + ############################################################################## + locales_backend: + name: Locales - Backend + runs-on: ubuntu-latest + needs: [build_test_backend] + steps: + ########################################################################## + # CHECKOUT CODE ########################################################## + ########################################################################## + - name: Checkout code + uses: actions/checkout@v3 + ########################################################################## + # LOCALES BACKEND ##################################################### + ########################################################################## + - name: Backend | Locales + run: cd backend && yarn && yarn locales + ############################################################################## # JOB: LINT DATABASE UP ###################################################### ############################################################################## @@ -478,7 +497,7 @@ jobs: report_name: Coverage Admin Interface type: lcov result_path: ./coverage/lcov.info - min_coverage: 96 + min_coverage: 97 token: ${{ github.token }} ############################################################################## @@ -526,7 +545,7 @@ jobs: report_name: Coverage Backend type: lcov result_path: ./backend/coverage/lcov.info - min_coverage: 78 + min_coverage: 80 token: ${{ github.token }} ########################################################################## diff --git a/CHANGELOG.md b/CHANGELOG.md index 366339834..4bfc66e39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,15 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [1.18.2](https://github.com/gradido/gradido/compare/1.18.1...1.18.2) + +- fix(admin): deny contribution button to left [`#2699`](https://github.com/gradido/gradido/pull/2699) + #### [1.18.1](https://github.com/gradido/gradido/compare/1.18.0...1.18.1) +> 10 February 2023 + +- chore(release): version 1.18.1 [`#2698`](https://github.com/gradido/gradido/pull/2698) - fix(frontend): fix is last month for empty form date [`#2697`](https://github.com/gradido/gradido/pull/2697) - fix(frontend): community link [`#2696`](https://github.com/gradido/gradido/pull/2696) diff --git a/admin/package.json b/admin/package.json index e443e7f9e..941a9bf69 100644 --- a/admin/package.json +++ b/admin/package.json @@ -3,7 +3,7 @@ "description": "Administraion Interface for Gradido", "main": "index.js", "author": "Moriz Wahl", - "version": "1.18.1", + "version": "1.18.2", "license": "Apache-2.0", "private": false, "scripts": { diff --git a/admin/src/components/ContributionLink/ContributionLink.spec.js b/admin/src/components/ContributionLink/ContributionLink.spec.js index b72a0347c..461027e64 100644 --- a/admin/src/components/ContributionLink/ContributionLink.spec.js +++ b/admin/src/components/ContributionLink/ContributionLink.spec.js @@ -42,14 +42,73 @@ describe('ContributionLink', () => { expect(wrapper.find('div.contribution-link').exists()).toBe(true) }) - it('emits toggle::collapse new Contribution', async () => { - wrapper.vm.editContributionLinkData() - expect(wrapper.vm.$root.$emit('bv::toggle::collapse', 'newContribution')).toBeTruthy() + it('has one contribution link in table', () => { + expect(wrapper.find('div.contribution-link-list').find('tbody').findAll('tr')).toHaveLength(1) }) - it('emits toggle::collapse close Contribution-Form ', async () => { - wrapper.vm.closeContributionForm() - expect(wrapper.vm.$root.$emit('bv::toggle::collapse', 'newContribution')).toBeTruthy() + it('has contribution form not visible by default', () => { + expect(wrapper.find('#newContribution').isVisible()).toBe(false) + }) + + describe('click on create new contribution', () => { + beforeEach(async () => { + await wrapper.find('[data-test="new-contribution-link-button"]').trigger('click') + }) + + it('shows the contribution form', () => { + expect(wrapper.find('#newContribution').isVisible()).toBe(true) + }) + + describe('click on create new contribution again', () => { + beforeEach(async () => { + await wrapper.find('[data-test="new-contribution-link-button"]').trigger('click') + }) + + it('closes the contribution form', () => { + expect(wrapper.find('#newContribution').isVisible()).toBe(false) + }) + }) + + describe('click on close button', () => { + beforeEach(async () => { + await wrapper.find('button.btn-secondary').trigger('click') + }) + + it('closes the contribution form', () => { + expect(wrapper.find('#newContribution').isVisible()).toBe(false) + }) + }) + }) + + describe('edit contribution link', () => { + beforeEach(async () => { + await wrapper + .find('div.contribution-link-list') + .find('tbody') + .findAll('tr') + .at(0) + .findAll('button') + .at(1) + .trigger('click') + }) + + it('shows the contribution form', () => { + expect(wrapper.find('#newContribution').isVisible()).toBe(true) + }) + + it('does not show the new contribution button', () => { + expect(wrapper.find('[data-test="new-contribution-link-button"]').exists()).toBe(false) + }) + + describe('click on close button', () => { + beforeEach(async () => { + await wrapper.find('button.btn-secondary').trigger('click') + }) + + it('closes the contribution form', () => { + expect(wrapper.find('#newContribution').isVisible()).toBe(false) + }) + }) }) }) }) diff --git a/admin/src/components/ContributionLink/ContributionLink.vue b/admin/src/components/ContributionLink/ContributionLink.vue index ca82fcd42..b369386b1 100644 --- a/admin/src/components/ContributionLink/ContributionLink.vue +++ b/admin/src/components/ContributionLink/ContributionLink.vue @@ -10,8 +10,9 @@ > {{ $t('math.plus') }} {{ $t('contributionLink.newContributionLink') }} diff --git a/admin/src/components/ContributionLink/ContributionLinkList.vue b/admin/src/components/ContributionLink/ContributionLinkList.vue index f67feced2..9d8977d04 100644 --- a/admin/src/components/ContributionLink/ContributionLinkList.vue +++ b/admin/src/components/ContributionLink/ContributionLinkList.vue @@ -70,8 +70,6 @@ export default { formatter: (value, key, item) => { if (value) { return this.$d(new Date(value)) - } else { - return null } }, }, @@ -81,8 +79,6 @@ export default { formatter: (value, key, item) => { if (value) { return this.$d(new Date(value)) - } else { - return null } }, }, diff --git a/admin/src/components/CreationTransactionList.spec.js b/admin/src/components/CreationTransactionList.spec.js index ff9607424..9613942f8 100644 --- a/admin/src/components/CreationTransactionList.spec.js +++ b/admin/src/components/CreationTransactionList.spec.js @@ -88,5 +88,16 @@ describe('CreationTransactionList', () => { expect(toastErrorSpy).toBeCalledWith('OUCH!') }) }) + + describe('watch currentPage', () => { + beforeEach(async () => { + jest.clearAllMocks() + await wrapper.setData({ currentPage: 2 }) + }) + + it('returns the string in normal order if reversed property is not true', () => { + expect(wrapper.vm.currentPage).toBe(2) + }) + }) }) }) diff --git a/admin/src/components/NavBar.spec.js b/admin/src/components/NavBar.spec.js index 139172c30..61f126904 100644 --- a/admin/src/components/NavBar.spec.js +++ b/admin/src/components/NavBar.spec.js @@ -46,43 +46,45 @@ describe('NavBar', () => { }) describe('Navbar Menu', () => { - it('has a link to overview', () => { - expect(wrapper.findAll('.nav-item').at(0).find('a').attributes('href')).toBe('/') - }) - it('has a link to /user', () => { - expect(wrapper.findAll('.nav-item').at(1).find('a').attributes('href')).toBe('/user') - }) - - it('has a link to /creation', () => { - expect(wrapper.findAll('.nav-item').at(2).find('a').attributes('href')).toBe('/creation') + expect(wrapper.findAll('.nav-item').at(0).find('a').attributes('href')).toBe('/user') }) it('has a link to /creation-confirm', () => { - expect(wrapper.findAll('.nav-item').at(3).find('a').attributes('href')).toBe( + expect(wrapper.findAll('.nav-item').at(1).find('a').attributes('href')).toBe( '/creation-confirm', ) }) it('has a link to /contribution-links', () => { - expect(wrapper.findAll('.nav-item').at(4).find('a').attributes('href')).toBe( + expect(wrapper.findAll('.nav-item').at(2).find('a').attributes('href')).toBe( '/contribution-links', ) }) it('has a link to /statistic', () => { - expect(wrapper.findAll('.nav-item').at(5).find('a').attributes('href')).toBe('/statistic') + expect(wrapper.findAll('.nav-item').at(3).find('a').attributes('href')).toBe('/statistic') }) }) describe('wallet', () => { - const assignLocationSpy = jest.fn() + const windowLocationMock = jest.fn() + const windowLocation = window.location beforeEach(async () => { - await wrapper.findAll('.nav-item').at(6).find('a').trigger('click') + delete window.location + window.location = { + assign: windowLocationMock, + } + await wrapper.findAll('.nav-item').at(5).find('a').trigger('click') + }) + + afterEach(() => { + delete window.location + window.location = windowLocation }) it.skip('changes window location to wallet', () => { - expect(assignLocationSpy).toBeCalledWith('valid-token') + expect(windowLocationMock()).toBe('valid-token') }) it('dispatches logout to store', () => { @@ -92,12 +94,18 @@ describe('NavBar', () => { describe('logout', () => { const windowLocationMock = jest.fn() + const windowLocation = window.location beforeEach(async () => { delete window.location window.location = { assign: windowLocationMock, } - await wrapper.findAll('.nav-item').at(7).find('a').trigger('click') + await wrapper.findAll('.nav-item').at(5).find('a').trigger('click') + }) + + afterEach(() => { + delete window.location + window.location = windowLocation }) it('redirects to /logout', () => { diff --git a/admin/src/components/NavBar.vue b/admin/src/components/NavBar.vue index 6bed8e6e4..7e2b7d76f 100644 --- a/admin/src/components/NavBar.vue +++ b/admin/src/components/NavBar.vue @@ -9,15 +9,12 @@ - {{ $t('navbar.overview') }} {{ $t('navbar.user_search') }} - {{ $t('navbar.multi_creation') }} - - {{ $store.state.openCreations }} {{ $t('navbar.open_creation') }} + + {{ $t('creation') }} + + {{ $store.state.openCreations }} + {{ $t('navbar.automaticContributions') }} @@ -57,7 +54,4 @@ export default { height: 2rem; padding-left: 10px; } -.bg-color-creation { - background-color: #cf1010dc; -} diff --git a/admin/src/components/Overlay.vue b/admin/src/components/Overlay.vue index 84271a422..7eb3cf99f 100644 --- a/admin/src/components/Overlay.vue +++ b/admin/src/components/Overlay.vue @@ -13,7 +13,8 @@ {{ $t('creation_for_month') }} - {{ $d(new Date(item.date), 'month') }} {{ $d(new Date(item.date), 'year') }} + {{ $d(new Date(item.contributionDate), 'month') }} + {{ $d(new Date(item.contributionDate), 'year') }} diff --git a/admin/src/components/Tables/OpenCreationsTable.vue b/admin/src/components/Tables/OpenCreationsTable.vue index d141fc0a5..faaf3a69d 100644 --- a/admin/src/components/Tables/OpenCreationsTable.vue +++ b/admin/src/components/Tables/OpenCreationsTable.vue @@ -1,6 +1,17 @@