diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cf0b061ef..92ac77d86 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -212,7 +212,7 @@ jobs: report_name: Coverage Frontend type: lcov result_path: ./coverage/lcov.info - min_coverage: 19 + min_coverage: 20 token: ${{ github.token }} #test: diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b03c78d5..a71ad2fd4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,36 @@ 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.0.2](https://github.com/gradido/gradido/compare/1.0.1...1.0.2) + +- fix: GDD Amount is Always Displayed with Two Digits [`#468`](https://github.com/gradido/gradido/pull/468) +- fix: Date Time Formats [`#469`](https://github.com/gradido/gradido/pull/469) +- Community ipv6 localhost [`#466`](https://github.com/gradido/gradido/pull/466) +- Login html pages autoparse [`#464`](https://github.com/gradido/gradido/pull/464) +- everything I find and fix crash related in login server this week (kw 20) [`#448`](https://github.com/gradido/gradido/pull/448) +- 437 bug mobile transaction list is not easy to read [`#462`](https://github.com/gradido/gradido/pull/462) +- Require memo in send [`#455`](https://github.com/gradido/gradido/pull/455) +- bug: Thx Page Shows Content Dependent of Route From [`#459`](https://github.com/gradido/gradido/pull/459) +- bug: responsive display error on pads fixed [`#461`](https://github.com/gradido/gradido/pull/461) +- [Bug] German "Dir" is written with capital D in send validation bug [`#460`](https://github.com/gradido/gradido/pull/460) +- feat: Save Locale in Database [`#450`](https://github.com/gradido/gradido/pull/450) +- attention! notice in send area removed [`#458`](https://github.com/gradido/gradido/pull/458) +- Remove Error Message encoding [`#456`](https://github.com/gradido/gradido/pull/456) +- bug fix:mobile menu closes on logout, probs value problem on logout f… [`#454`](https://github.com/gradido/gradido/pull/454) +- bug-login password change show hide inserted [`#453`](https://github.com/gradido/gradido/pull/453) +- fix sorting and use total count [`#451`](https://github.com/gradido/gradido/pull/451) +- add dynamic error email if transaction failed [`#452`](https://github.com/gradido/gradido/pull/452) +- ceil the last decay [`#449`](https://github.com/gradido/gradido/pull/449) +- feat: Raise Coverage of Frontend Unit Tets to 18% [`#447`](https://github.com/gradido/gradido/pull/447) +- parse cpsp files automatic in build [`a4a12bb`](https://github.com/gradido/gradido/commit/a4a12bb62b4000e035ff15e17c5a5f5861653ff6) +- translate german html encoded error messages to english and use gettext for automatic translation [`d339627`](https://github.com/gradido/gradido/commit/d33962736d94c1cb7a12ff775bc2c8d7505d646e) +- 100% coverage of GddTransactionList [`96fb245`](https://github.com/gradido/gradido/commit/96fb245821c69f4d321204a663247d5eee60d92f) + #### [1.0.1](https://github.com/gradido/gradido/compare/1.0.0...1.0.1) +> 14 May 2021 + +- Login crash fix [`#444`](https://github.com/gradido/gradido/pull/444) - add try catch blocks to prevent login-server from crashing [`22ff220`](https://github.com/gradido/gradido/commit/22ff22072956f8b843037c75c5b16b7ff5d6a2a3) - fix [`14a4243`](https://github.com/gradido/gradido/commit/14a424347817b1fe6912a113bffd70e55d688112) diff --git a/frontend/package.json b/frontend/package.json index 21b02ee2e..4371a6a57 100755 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "bootstrap-vue-gradido-wallet", - "version": "1.0.1", + "version": "1.0.2", "private": true, "scripts": { "start": "node run/server.js", diff --git a/frontend/src/views/Pages/AccountOverview/GddSend/TransactionForm.spec.js b/frontend/src/views/Pages/AccountOverview/GddSend/TransactionForm.spec.js index 942ff35fc..36b8b3042 100644 --- a/frontend/src/views/Pages/AccountOverview/GddSend/TransactionForm.spec.js +++ b/frontend/src/views/Pages/AccountOverview/GddSend/TransactionForm.spec.js @@ -8,9 +8,6 @@ describe('GddSend', () => { const mocks = { $t: jest.fn((t) => t), - $moment: jest.fn((m) => ({ - format: () => m, - })), $i18n: { locale: jest.fn(() => 'en'), }, diff --git a/frontend/src/views/Pages/AccountOverview/GddTransactionList.spec.js b/frontend/src/views/Pages/AccountOverview/GddTransactionList.spec.js new file mode 100644 index 000000000..af084d784 --- /dev/null +++ b/frontend/src/views/Pages/AccountOverview/GddTransactionList.spec.js @@ -0,0 +1,238 @@ +import { mount } from '@vue/test-utils' +import GddTransactionList from './GddTransactionList' + +const localVue = global.localVue + +const errorHandler = jest.fn() + +localVue.config.errorHandler = errorHandler + +describe('GddTransactionList', () => { + let wrapper + + const mocks = { + $n: jest.fn((n) => n), + $t: jest.fn((t) => t), + $d: jest.fn((d) => d), + } + + const Wrapper = () => { + return mount(GddTransactionList, { localVue, mocks }) + } + + describe('mount', () => { + beforeEach(() => { + wrapper = Wrapper() + }) + + it('renders the component', () => { + expect(wrapper.find('div.gdd-transaction-list').exists()).toBeTruthy() + }) + + describe('without any properties', () => { + it('renders text saying that there are no transactions', () => { + expect(wrapper.find('div.gdd-transaction-list').text()).toBe('transaction.nullTransactions') + }) + }) + + describe('timestamp property', () => { + it('emits update-transactions when timestamp changes', async () => { + await wrapper.setProps({ timestamp: 0 }) + expect(wrapper.emitted('update-transactions')).toBeTruthy() + }) + }) + + describe('with transactions', () => { + beforeEach(async () => { + await wrapper.setProps({ + transactions: [ + { + balance: '19.93', + date: '2021-05-25T17:38:13+00:00', + memo: 'Alles Gute zum Geburtstag', + name: 'Bob der Baumeister', + transaction_id: 29, + type: 'send', + }, + { + balance: '1000', + date: '2021-04-29T15:34:49+00:00', + memo: 'Gut das du da bist!', + name: 'Gradido Akademie', + transaction_id: 3, + type: 'creation', + }, + { + balance: '314.98', + date: '2021-04-29T17:26:40+00:00', + memo: 'Für das Fahrrad!', + name: 'Jan Ulrich', + transaction_id: 8, + type: 'receive', + }, + { + balance: '1.07', + type: 'decay', + }, + ], + transactionCount: 12, + }) + }) + + it('renders 4 transactions', () => { + expect(wrapper.findAll('div.gdd-transaction-list-item')).toHaveLength(4) + }) + + describe('send transactions', () => { + let transaction + beforeEach(() => { + transaction = wrapper.findAll('div.gdd-transaction-list-item').at(0) + }) + + it('has a bi-arrow-left-circle icon', () => { + expect(transaction.find('svg').classes()).toContain('bi-arrow-left-circle') + }) + + it('has text-danger color', () => { + expect(transaction.find('svg').classes()).toContain('text-danger') + }) + + it('shows the amount of transaction', () => { + expect(transaction.findAll('div').at(2).text()).toContain('19.93') + }) + + it('has a minus operator', () => { + expect(transaction.findAll('div').at(2).text()).toContain('-') + }) + + it('shows the name of the receiver', () => { + expect(transaction.findAll('div').at(3).text()).toContain('Bob der Baumeister') + }) + + it('shows the date of the transaction', () => { + expect(transaction.findAll('div').at(3).text()).toContain('Tue May 25 2021') + }) + }) + + describe('creation transactions', () => { + let transaction + beforeEach(() => { + transaction = wrapper.findAll('div.gdd-transaction-list-item').at(1) + }) + + it('has a bi-gift icon', () => { + expect(transaction.find('svg').classes()).toContain('bi-gift') + }) + + it('has gradido-global-color-accent color', () => { + expect(transaction.find('svg').classes()).toContain('gradido-global-color-accent') + }) + + it('shows the amount of transaction', () => { + expect(transaction.findAll('div').at(2).text()).toContain('1000') + }) + + it('has a plus operator', () => { + expect(transaction.findAll('div').at(2).text()).toContain('+') + }) + + it('shows the name of the receiver', () => { + expect(transaction.findAll('div').at(3).text()).toContain('Gradido Akademie') + }) + + it('shows the date of the transaction', () => { + expect(transaction.findAll('div').at(3).text()).toContain('Thu Apr 29 2021') + }) + }) + + describe('receive transactions', () => { + let transaction + beforeEach(() => { + transaction = wrapper.findAll('div.gdd-transaction-list-item').at(2) + }) + + it('has a bi-arrow-right-circle icon', () => { + expect(transaction.find('svg').classes()).toContain('bi-arrow-right-circle') + }) + + it('has gradido-global-color-accent color', () => { + expect(transaction.find('svg').classes()).toContain('gradido-global-color-accent') + }) + + it('shows the amount of transaction', () => { + expect(transaction.findAll('div').at(2).text()).toContain('314.98') + }) + + it('has a plus operator', () => { + expect(transaction.findAll('div').at(2).text()).toContain('+') + }) + + it('shows the name of the receiver', () => { + expect(transaction.findAll('div').at(3).text()).toContain('Jan Ulrich') + }) + + it('shows the date of the transaction', () => { + expect(transaction.findAll('div').at(3).text()).toContain('Thu Apr 29 2021') + }) + }) + + describe('decay transactions', () => { + let transaction + beforeEach(() => { + transaction = wrapper.findAll('div.gdd-transaction-list-item').at(3) + }) + + it('has a bi-droplet-half icon', () => { + expect(transaction.find('svg').classes()).toContain('bi-droplet-half') + }) + + it('has gradido-global-color-gray color', () => { + expect(transaction.find('svg').classes()).toContain('gradido-global-color-gray') + }) + + it('shows the amount of transaction', () => { + expect(transaction.findAll('div').at(2).text()).toContain('1.07') + }) + + it('has a minus operator', () => { + expect(transaction.findAll('div').at(2).text()).toContain('-') + }) + + it('shows the name of the receiver', () => { + expect(transaction.findAll('div').at(3).text()).toBe('decay') + }) + }) + + describe('max property set to 2', () => { + beforeEach(async () => { + await wrapper.setProps({ max: 2 }) + }) + + it('shows only 2 transactions', () => { + expect(wrapper.findAll('div.gdd-transaction-list-item')).toHaveLength(2) + }) + }) + }) + + describe('with invalid transaction type', () => { + beforeEach(async () => { + await wrapper.setProps({ + transactions: [ + { + balance: '19.93', + date: '2021-05-25T17:38:13+00:00', + memo: 'Alles Gute zum Geburtstag', + name: 'Bob der Baumeister', + transaction_id: 29, + type: 'invalid', + }, + ], + }) + }) + + it('throws an error', () => { + expect(errorHandler).toHaveBeenCalled() + }) + }) + }) +}) diff --git a/frontend/src/views/Pages/AccountOverview/GddTransactionList.vue b/frontend/src/views/Pages/AccountOverview/GddTransactionList.vue index d7ef1b8ac..d2a81cdbf 100644 --- a/frontend/src/views/Pages/AccountOverview/GddTransactionList.vue +++ b/frontend/src/views/Pages/AccountOverview/GddTransactionList.vue @@ -1,22 +1,21 @@