diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2579fa28d..afb0c5314 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -441,7 +441,7 @@ jobs: report_name: Coverage Admin Interface type: lcov result_path: ./coverage/lcov.info - min_coverage: 51 + min_coverage: 53 token: ${{ github.token }} ############################################################################## diff --git a/README.md b/README.md index ead54701c..ce8e84df0 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,22 @@ We are currently restructuring the service to reduce dependencies and unify busi Once you have `docker-compose` up and running, you can open [http://localhost/vue](http://localhost/vue) and create yourself a new wallet account. +## How to release + +A release is tagged on Github by its version number and published as github release. This is done automatically when a new version is defined in the [package.json](./package.json) and merged into master - furthermore we set all our sub-package-versions to the same version as the main package.json version to make version management as simple as possible. +Each release is accompanied with release notes automatically generated from the git log which is available as [CHANGELOG.md](./CHANGELOG.md). + +To generate the Changelog and set a new Version you should use the following commands in the main folder +```bash +git fetch --all +yarn release +``` + +The first command `git fetch --all` will make sure you have all tags previously defined which is required to generate a correct changelog. The second command `yarn release` will execute the changelog tool and set version numbers in the main package and sub-packages. It is required to do `yarn install` before you can use this command. +After generating a new version you should commit the changes. This will be the CHANGELOG.md and several package.json files. This commit will be omitted in the changelog. + +Note: The Changelog will be regenerated with all tags on release on the external builder tool, but will not be checked in there. The Changelog on the github release will therefore always be correct, on the repo it might be incorrect due to missing tags when executing the `yarn release` command. + ## Troubleshooting | Problem | Issue | Solution | Description | diff --git a/admin/package.json b/admin/package.json index e3c94f5d8..9d70c0b06 100644 --- a/admin/package.json +++ b/admin/package.json @@ -43,6 +43,7 @@ "vue-jest": "^3.0.7", "vue-moment": "^4.1.0", "vue-router": "^3.5.3", + "vue-toasted": "^1.1.28", "vuex": "^3.6.2", "vuex-persistedstate": "^4.1.0" }, diff --git a/admin/public/img/brand/green.png b/admin/public/img/brand/green.png new file mode 100644 index 000000000..bb7f12c39 Binary files /dev/null and b/admin/public/img/brand/green.png differ diff --git a/admin/src/components/CreationFormular.spec.js b/admin/src/components/CreationFormular.spec.js index fcdf97cfa..e1bbff1cc 100644 --- a/admin/src/components/CreationFormular.spec.js +++ b/admin/src/components/CreationFormular.spec.js @@ -3,6 +3,16 @@ import CreationFormular from './CreationFormular.vue' const localVue = global.localVue +const apolloMock = jest.fn().mockResolvedValue({ + data: { + verifyLogin: { + name: 'success', + id: 0, + }, + }, +}) +const stateCommitMock = jest.fn() + const mocks = { $moment: jest.fn(() => { return { @@ -14,6 +24,12 @@ const mocks = { }), } }), + $apollo: { + query: apolloMock, + }, + $store: { + commit: stateCommitMock, + }, } const propsData = { @@ -39,6 +55,23 @@ describe('CreationFormular', () => { expect(wrapper.find('.component-creation-formular').exists()).toBeTruthy() }) + describe('server sends back moderator data', () => { + it('called store commit with mocked data', () => { + expect(stateCommitMock).toBeCalledWith('moderator', { name: 'success', id: 0 }) + }) + }) + + describe('server throws error for moderator data call', () => { + beforeEach(() => { + jest.clearAllMocks() + apolloMock.mockRejectedValue({ message: 'Ouch!' }) + wrapper = Wrapper() + }) + it('has called store commit with fake data', () => { + expect(stateCommitMock).toBeCalledWith('moderator', { id: 0, name: 'Test Moderator' }) + }) + }) + describe('radio buttons to selcet month', () => { it('has three radio buttons', () => { expect(wrapper.findAll('input[type="radio"]').length).toBe(3) diff --git a/admin/src/components/CreationFormular.vue b/admin/src/components/CreationFormular.vue index d6b637152..b6a12433e 100644 --- a/admin/src/components/CreationFormular.vue +++ b/admin/src/components/CreationFormular.vue @@ -7,7 +7,6 @@ ? 'Einzelschöpfung für ' + item.firstName + ' ' + item.lastName + '' : 'Mehrfachschöpfung für ' + Object.keys(this.itemsMassCreation).length + ' Mitglieder' }} - {{ item }}
Bitte wähle ein oder Mehrere Mitglieder aus für die du Schöpfen möchtest @@ -24,6 +23,7 @@ @@ -34,6 +34,7 @@ @@ -44,6 +45,7 @@ @@ -52,30 +54,29 @@ - + - - - - +
+ + + - + + + +
@@ -125,6 +126,8 @@
diff --git a/admin/src/components/NavBar.spec.js b/admin/src/components/NavBar.spec.js index 1d68b16ad..ad3ed54fd 100644 --- a/admin/src/components/NavBar.spec.js +++ b/admin/src/components/NavBar.spec.js @@ -3,11 +3,19 @@ import NavBar from './NavBar.vue' const localVue = global.localVue +const storeDispatchMock = jest.fn() +const routerPushMock = jest.fn() + const mocks = { $store: { state: { openCreations: 1, + token: 'valid-token', }, + dispatch: storeDispatchMock, + }, + $router: { + push: routerPushMock, }, } @@ -27,4 +35,34 @@ describe('NavBar', () => { expect(wrapper.find('.component-nabvar').exists()).toBeTruthy() }) }) + + describe('wallet', () => { + const assignLocationSpy = jest.fn() + beforeEach(async () => { + await wrapper.findAll('a').at(5).trigger('click') + }) + + it.skip('changes widnow location to wallet', () => { + expect(assignLocationSpy).toBeCalledWith('valid-token') + }) + + it('dispatches logout to store', () => { + expect(storeDispatchMock).toBeCalledWith('logout') + }) + }) + + describe('logout', () => { + // const assignLocationSpy = jest.fn() + beforeEach(async () => { + await wrapper.findAll('a').at(6).trigger('click') + }) + + it('redirects to /logout', () => { + expect(routerPushMock).toBeCalledWith('/logout') + }) + + it('dispatches logout to store', () => { + expect(storeDispatchMock).toBeCalledWith('logout') + }) + }) }) diff --git a/admin/src/components/NavBar.vue b/admin/src/components/NavBar.vue index c52743857..208a6fa70 100644 --- a/admin/src/components/NavBar.vue +++ b/admin/src/components/NavBar.vue @@ -1,12 +1,15 @@