From 8f42aa60d71c34802cc4f626834252195672a591 Mon Sep 17 00:00:00 2001 From: ogerly Date: Wed, 6 Oct 2021 09:19:51 +0200 Subject: [PATCH 01/35] repair branch 707-Separate-Account-Overview-from-Send-Form from 937-Frontend-style-documentation --- frontend/package.json | 4 +- frontend/src/components/Charts/BarChart.js | 13 ++ frontend/src/components/Charts/LineChart.js | 13 ++ frontend/src/locales/de.json | 1 + frontend/src/locales/en.json | 1 + frontend/src/main.js | 3 +- frontend/src/routes/routes.js | 7 + .../src/views/Layout/DashboardLayout_gdd.vue | 9 +- frontend/src/views/Pages/AccountOverview.vue | 146 ++++++++++++------ frontend/src/views/Pages/SendOverview.vue | 120 ++++++++++++++ frontend/yarn.lock | 30 +--- 11 files changed, 269 insertions(+), 78 deletions(-) create mode 100644 frontend/src/components/Charts/BarChart.js create mode 100644 frontend/src/components/Charts/LineChart.js create mode 100644 frontend/src/views/Pages/SendOverview.vue diff --git a/frontend/package.json b/frontend/package.json index 5827baa5e..b6862d117 100755 --- a/frontend/package.json +++ b/frontend/package.json @@ -26,7 +26,7 @@ "babel-preset-vue": "^2.0.2", "bootstrap": "4.3.1", "bootstrap-vue": "^2.5.0", - "chart.js": "^2.9.3", + "chart.js": "^3.5.1", "d3": "^5.7.0", "datamaps": "^0.5.9", "date-fns": "^1.30.1", @@ -64,7 +64,7 @@ "vue": "^2.6.11", "vue-apollo": "^3.0.7", "vue-bootstrap-typeahead": "^0.2.6", - "vue-chartjs": "^3.5.0", + "vue-chartjs": "^3.5.1", "vue-cli-plugin-i18n": "^1.0.1", "vue-clickaway": "^2.2.2", "vue-clipboard2": "^0.3.0", diff --git a/frontend/src/components/Charts/BarChart.js b/frontend/src/components/Charts/BarChart.js new file mode 100644 index 000000000..c36d8ba53 --- /dev/null +++ b/frontend/src/components/Charts/BarChart.js @@ -0,0 +1,13 @@ +import { Bar, mixins } from 'vue-chartjs' +const { reactiveProp } = mixins + +export default { + extends: Bar, + mixins: [reactiveProp], + props: ['options'], + mounted () { + // this.chartData is created in the mixin. + // If you want to pass options please create a local options object + this.renderChart(this.chartData, this.options) + } +} \ No newline at end of file diff --git a/frontend/src/components/Charts/LineChart.js b/frontend/src/components/Charts/LineChart.js new file mode 100644 index 000000000..a0733c320 --- /dev/null +++ b/frontend/src/components/Charts/LineChart.js @@ -0,0 +1,13 @@ +import { Line, mixins } from 'vue-chartjs' +const { reactiveProp } = mixins + +export default { + extends: Line, + mixins: [reactiveProp], + props: ['options'], + mounted () { + // this.chartData is created in the mixin. + // If you want to pass options please create a local options object + this.renderChart(this.chartData, this.options) + } +} \ No newline at end of file diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index baf86c747..ad0cf9335 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -103,6 +103,7 @@ "members_area": "Mitgliederbereich", "message": "hallo gradido !!", "privacy_policy": "Datenschutzerklärung", + "overview": "Übersicht", "send": "Senden", "settings": { "coinanimation": { diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index e0e0aa292..454f34dbd 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -103,6 +103,7 @@ "members_area": "Member's area", "message": "hello gradido !!", "privacy_policy": "Privacy policy", + "overview": "Overview", "send": "Send", "settings": { "coinanimation": { diff --git a/frontend/src/main.js b/frontend/src/main.js index ba7015049..f71441924 100755 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -6,7 +6,7 @@ import { loadAllRules } from './validation-rules' import { ApolloClient, ApolloLink, InMemoryCache, HttpLink } from 'apollo-boost' import VueApollo from 'vue-apollo' import CONFIG from './config' - +import VueCharts from 'vue-chartjs' import { store } from './store/store' import router from './routes/router' @@ -64,5 +64,6 @@ new Vue({ store, i18n, apolloProvider, + VueCharts, render: (h) => h(App), }) diff --git a/frontend/src/routes/routes.js b/frontend/src/routes/routes.js index 34d7a9d70..a662de10d 100755 --- a/frontend/src/routes/routes.js +++ b/frontend/src/routes/routes.js @@ -14,6 +14,13 @@ const routes = [ requiresAuth: true, }, }, + { + path: '/send', + component: () => import('../views/Pages/SendOverview.vue'), + meta: { + requiresAuth: true, + }, + }, { path: '/profile', component: () => import('../views/Pages/UserProfileOverview.vue'), diff --git a/frontend/src/views/Layout/DashboardLayout_gdd.vue b/frontend/src/views/Layout/DashboardLayout_gdd.vue index 2b63bf417..8273685bd 100755 --- a/frontend/src/views/Layout/DashboardLayout_gdd.vue +++ b/frontend/src/views/Layout/DashboardLayout_gdd.vue @@ -2,11 +2,16 @@
diff --git a/frontend/src/views/Pages/SendOverview.vue b/frontend/src/views/Pages/SendOverview.vue new file mode 100644 index 000000000..d90dc6adc --- /dev/null +++ b/frontend/src/views/Pages/SendOverview.vue @@ -0,0 +1,120 @@ + + diff --git a/frontend/yarn.lock b/frontend/yarn.lock index b52b6b670..047ac28e0 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -3808,28 +3808,10 @@ chardet@^0.4.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" integrity sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I= -chart.js@^2.9.3: - version "2.9.4" - resolved "https://registry.yarnpkg.com/chart.js/-/chart.js-2.9.4.tgz#0827f9563faffb2dc5c06562f8eb10337d5b9684" - integrity sha512-B07aAzxcrikjAPyV+01j7BmOpxtQETxTSlQ26BEYJ+3iUkbNKaOJ/nDbT6JjyqYxseM0ON12COHYdU2cTIjC7A== - dependencies: - chartjs-color "^2.1.0" - moment "^2.10.2" - -chartjs-color-string@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/chartjs-color-string/-/chartjs-color-string-0.6.0.tgz#1df096621c0e70720a64f4135ea171d051402f71" - integrity sha512-TIB5OKn1hPJvO7JcteW4WY/63v6KwEdt6udfnDE9iCAZgy+V4SrbSxoIbTw/xkUIapjEI4ExGtD0+6D3KyFd7A== - dependencies: - color-name "^1.0.0" - -chartjs-color@^2.1.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/chartjs-color/-/chartjs-color-2.4.1.tgz#6118bba202fe1ea79dd7f7c0f9da93467296c3b0" - integrity sha512-haqOg1+Yebys/Ts/9bLo/BqUcONQOdr/hoEr2LLTRl6C5LXctUdHxsCYfvQVg5JIxITrfCNUDr4ntqmQk9+/0w== - dependencies: - chartjs-color-string "^0.6.0" - color-convert "^1.9.3" +chart.js@^3.5.1: + version "3.5.1" + resolved "https://registry.yarnpkg.com/chart.js/-/chart.js-3.5.1.tgz#73e24d23a4134a70ccdb5e79a917f156b6f3644a" + integrity sha512-m5kzt72I1WQ9LILwQC4syla/LD/N413RYv2Dx2nnTkRS9iv/ey1xLTt0DnPc/eWV4zI+BgEgDYBIzbQhZHc/PQ== check-types@^8.0.3: version "8.0.3" @@ -4058,7 +4040,7 @@ collection-visit@^1.0.0: map-visit "^1.0.0" object-visit "^1.0.0" -color-convert@^1.9.0, color-convert@^1.9.1, color-convert@^1.9.3: +color-convert@^1.9.0, color-convert@^1.9.1: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== @@ -13421,7 +13403,7 @@ vue-bootstrap-typeahead@^0.2.6: resize-observer-polyfill "^1.5.0" vue "^2.5.17" -vue-chartjs@^3.5.0: +vue-chartjs@^3.5.1: version "3.5.1" resolved "https://registry.yarnpkg.com/vue-chartjs/-/vue-chartjs-3.5.1.tgz#d25e845708f7744ae51bed9d23a975f5f8fc6529" integrity sha512-foocQbJ7FtveICxb4EV5QuVpo6d8CmZFmAopBppDIGKY+esJV8IJgwmEW0RexQhxqXaL/E1xNURsgFFYyKzS/g== From 8b45d0da5806a007a0cee85c12787fccd1d11113 Mon Sep 17 00:00:00 2001 From: ogerly Date: Wed, 6 Oct 2021 14:10:11 +0200 Subject: [PATCH 02/35] removevue-chartjs chart.js --- frontend/package.json | 2 - frontend/src/components/Charts/BarChart.js | 13 --- frontend/src/components/Charts/LineChart.js | 13 --- frontend/src/views/Pages/AccountOverview.vue | 91 +++----------------- frontend/yarn.lock | 21 +---- 5 files changed, 11 insertions(+), 129 deletions(-) delete mode 100644 frontend/src/components/Charts/BarChart.js delete mode 100644 frontend/src/components/Charts/LineChart.js diff --git a/frontend/package.json b/frontend/package.json index b6862d117..3dde845f4 100755 --- a/frontend/package.json +++ b/frontend/package.json @@ -26,7 +26,6 @@ "babel-preset-vue": "^2.0.2", "bootstrap": "4.3.1", "bootstrap-vue": "^2.5.0", - "chart.js": "^3.5.1", "d3": "^5.7.0", "datamaps": "^0.5.9", "date-fns": "^1.30.1", @@ -64,7 +63,6 @@ "vue": "^2.6.11", "vue-apollo": "^3.0.7", "vue-bootstrap-typeahead": "^0.2.6", - "vue-chartjs": "^3.5.1", "vue-cli-plugin-i18n": "^1.0.1", "vue-clickaway": "^2.2.2", "vue-clipboard2": "^0.3.0", diff --git a/frontend/src/components/Charts/BarChart.js b/frontend/src/components/Charts/BarChart.js deleted file mode 100644 index c36d8ba53..000000000 --- a/frontend/src/components/Charts/BarChart.js +++ /dev/null @@ -1,13 +0,0 @@ -import { Bar, mixins } from 'vue-chartjs' -const { reactiveProp } = mixins - -export default { - extends: Bar, - mixins: [reactiveProp], - props: ['options'], - mounted () { - // this.chartData is created in the mixin. - // If you want to pass options please create a local options object - this.renderChart(this.chartData, this.options) - } -} \ No newline at end of file diff --git a/frontend/src/components/Charts/LineChart.js b/frontend/src/components/Charts/LineChart.js deleted file mode 100644 index a0733c320..000000000 --- a/frontend/src/components/Charts/LineChart.js +++ /dev/null @@ -1,13 +0,0 @@ -import { Line, mixins } from 'vue-chartjs' -const { reactiveProp } = mixins - -export default { - extends: Line, - mixins: [reactiveProp], - props: ['options'], - mounted () { - // this.chartData is created in the mixin. - // If you want to pass options please create a local options object - this.renderChart(this.chartData, this.options) - } -} \ No newline at end of file diff --git a/frontend/src/views/Pages/AccountOverview.vue b/frontend/src/views/Pages/AccountOverview.vue index d92ddc5d8..41d75a27c 100644 --- a/frontend/src/views/Pages/AccountOverview.vue +++ b/frontend/src/views/Pages/AccountOverview.vue @@ -10,31 +10,19 @@

GDD Statistik - -
- -
- -
- -
+
GDT Statistik -
- -
- -
- -
+ + - -
+
UserAccount Statistik - -
- -
- -
- -
+
diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 047ac28e0..490927518 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -1730,13 +1730,6 @@ dependencies: "@babel/types" "^7.3.0" -"@types/chart.js@^2.7.55": - version "2.9.30" - resolved "https://registry.yarnpkg.com/@types/chart.js/-/chart.js-2.9.30.tgz#34b99897f4f5ef0f74c8fe4ced70ac52b4d752dd" - integrity sha512-EgjxUUZFvf6ls3kW2CwyrnSJhgyKxgwrlp/W5G9wqyPEO9iFatO63zAA7L24YqgMxiDjQ+tG7ODU+2yWH91lPg== - dependencies: - moment "^2.10.2" - "@types/d3@3.5.38": version "3.5.38" resolved "https://registry.yarnpkg.com/@types/d3/-/d3-3.5.38.tgz#76f8f2e9159ae562965b2fa0e6fbee1aa643a1bc" @@ -3808,11 +3801,6 @@ chardet@^0.4.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" integrity sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I= -chart.js@^3.5.1: - version "3.5.1" - resolved "https://registry.yarnpkg.com/chart.js/-/chart.js-3.5.1.tgz#73e24d23a4134a70ccdb5e79a917f156b6f3644a" - integrity sha512-m5kzt72I1WQ9LILwQC4syla/LD/N413RYv2Dx2nnTkRS9iv/ey1xLTt0DnPc/eWV4zI+BgEgDYBIzbQhZHc/PQ== - check-types@^8.0.3: version "8.0.3" resolved "https://registry.yarnpkg.com/check-types/-/check-types-8.0.3.tgz#3356cca19c889544f2d7a95ed49ce508a0ecf552" @@ -9575,7 +9563,7 @@ mkdirp@^1.0.3, mkdirp@^1.0.4: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== -moment@^2.10.2, moment@^2.19.2: +moment@^2.19.2: version "2.29.1" resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3" integrity sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ== @@ -13403,13 +13391,6 @@ vue-bootstrap-typeahead@^0.2.6: resize-observer-polyfill "^1.5.0" vue "^2.5.17" -vue-chartjs@^3.5.1: - version "3.5.1" - resolved "https://registry.yarnpkg.com/vue-chartjs/-/vue-chartjs-3.5.1.tgz#d25e845708f7744ae51bed9d23a975f5f8fc6529" - integrity sha512-foocQbJ7FtveICxb4EV5QuVpo6d8CmZFmAopBppDIGKY+esJV8IJgwmEW0RexQhxqXaL/E1xNURsgFFYyKzS/g== - dependencies: - "@types/chart.js" "^2.7.55" - vue-cli-plugin-i18n@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/vue-cli-plugin-i18n/-/vue-cli-plugin-i18n-1.0.1.tgz#5a3077de5d62c9b4068e486db1fc97fce9fa0072" From db1124da3f7cced87c889cf528ec4c7fc6508e1c Mon Sep 17 00:00:00 2001 From: ogerly Date: Wed, 13 Oct 2021 16:13:28 +0200 Subject: [PATCH 03/35] separate pages: overview and send. apexcharts library inserted. example charts created: lienen and bar charts. example charts inserted --- frontend/package.json | 2 + .../src/components/charts/ChartExample.vue | 112 +++++++++ frontend/src/components/charts/series.js | 224 ++++++++++++++++++ frontend/src/i18n.js | 5 + frontend/src/locales/de.json | 2 +- frontend/src/locales/en.json | 2 +- frontend/src/main.js | 6 +- .../views/Layout/DashboardLayout_gdd.spec.js | 36 ++- .../src/views/Pages/AccountOverview.spec.js | 110 +-------- frontend/src/views/Pages/AccountOverview.vue | 107 ++++++--- .../views/Pages/AccountOverview/GddStatus.vue | 30 --- ...GddStatus.spec.js => GddGdtStatus.spec.js} | 10 +- frontend/src/views/Pages/GddGdtStatus.vue | 32 +++ frontend/src/views/Pages/SendOverview.spec.js | 135 +++++++++++ frontend/src/views/Pages/SendOverview.vue | 30 ++- .../GddSend.spec.js | 0 .../GddSend.vue | 0 .../GddSend/QrCode.vue | 0 .../GddSend/TransactionConfirmation.vue | 0 .../GddSend/TransactionForm.spec.js | 0 .../GddSend/TransactionForm.vue | 0 .../GddSend/TransactionResult.vue | 0 frontend/test/testSetup.js | 2 + frontend/yarn.lock | 72 ++++++ 24 files changed, 715 insertions(+), 202 deletions(-) create mode 100644 frontend/src/components/charts/ChartExample.vue create mode 100644 frontend/src/components/charts/series.js delete mode 100644 frontend/src/views/Pages/AccountOverview/GddStatus.vue rename frontend/src/views/Pages/{AccountOverview/GddStatus.spec.js => GddGdtStatus.spec.js} (70%) create mode 100644 frontend/src/views/Pages/GddGdtStatus.vue create mode 100644 frontend/src/views/Pages/SendOverview.spec.js rename frontend/src/views/Pages/{AccountOverview => SendOverview}/GddSend.spec.js (100%) rename frontend/src/views/Pages/{AccountOverview => SendOverview}/GddSend.vue (100%) rename frontend/src/views/Pages/{AccountOverview => SendOverview}/GddSend/QrCode.vue (100%) rename frontend/src/views/Pages/{AccountOverview => SendOverview}/GddSend/TransactionConfirmation.vue (100%) rename frontend/src/views/Pages/{AccountOverview => SendOverview}/GddSend/TransactionForm.spec.js (100%) rename frontend/src/views/Pages/{AccountOverview => SendOverview}/GddSend/TransactionForm.vue (100%) rename frontend/src/views/Pages/{AccountOverview => SendOverview}/GddSend/TransactionResult.vue (100%) diff --git a/frontend/package.json b/frontend/package.json index 3dde845f4..d45c29e34 100755 --- a/frontend/package.json +++ b/frontend/package.json @@ -18,6 +18,7 @@ "@babel/preset-env": "^7.13.12", "@vue/cli-plugin-unit-jest": "^4.5.12", "@vue/test-utils": "^1.1.3", + "apexcharts": "^3.28.3", "apollo-boost": "^0.4.9", "axios": "^0.21.1", "babel-core": "^7.0.0-bridge.0", @@ -61,6 +62,7 @@ "sweetalert2": "^9.5.4", "vee-validate": "^3.4.5", "vue": "^2.6.11", + "vue-apexcharts": "^1.6.2", "vue-apollo": "^3.0.7", "vue-bootstrap-typeahead": "^0.2.6", "vue-cli-plugin-i18n": "^1.0.1", diff --git a/frontend/src/components/charts/ChartExample.vue b/frontend/src/components/charts/ChartExample.vue new file mode 100644 index 000000000..7c740f512 --- /dev/null +++ b/frontend/src/components/charts/ChartExample.vue @@ -0,0 +1,112 @@ + + + diff --git a/frontend/src/components/charts/series.js b/frontend/src/components/charts/series.js new file mode 100644 index 000000000..759a2d401 --- /dev/null +++ b/frontend/src/components/charts/series.js @@ -0,0 +1,224 @@ +export const series = [ + { + name: 'obb.docker', + data: [ + { + x: '2018-09-25', + y: 900, + }, + { + x: '2018-09-26', + y: 900, + }, + { + x: '2018-09-27', + y: 900, + }, + { + x: '2018-09-28', + y: 900, + }, + { + x: '2018-09-29', + y: 900, + }, + { + x: '2018-09-30', + y: 900, + }, + { + x: '2018-10-01', + y: 900, + }, + { + x: '2018-10-02', + y: 1125, + }, + ], + }, + { + name: 'filato.dk', + data: [ + { + x: '2018-09-25', + y: 1251.45, + }, + { + x: '2018-09-26', + y: 984.94, + }, + { + x: '2018-09-27', + y: 1170.34, + }, + { + x: '2018-09-28', + y: 1193.51, + }, + { + x: '2018-09-29', + y: 1251.45, + }, + { + x: '2018-09-30', + y: 1147.16, + }, + { + x: '2018-10-01', + y: 1263.04, + }, + { + x: '2018-10-02', + y: 1158.75, + }, + ], + }, + { + name: 'rito.dk', + data: [ + { + x: '2018-09-25', + y: 1193.06, + }, + { + x: '2018-09-26', + y: 1193.06, + }, + { + x: '2018-09-27', + y: 1068.08, + }, + { + x: '2018-09-28', + y: 909, + }, + { + x: '2018-09-29', + y: 965.81, + }, + { + x: '2018-09-30', + y: 965.81, + }, + { + x: '2018-10-01', + y: 1022.63, + }, + { + x: '2018-10-02', + y: 1136.25, + }, + ], + }, + { + name: 'fruhyasinth.dk', + data: [ + { + x: '2018-09-25', + y: 1064.7, + }, + { + x: '2018-09-26', + y: 1146.6, + }, + { + x: '2018-09-27', + y: 1216.8, + }, + { + x: '2018-09-28', + y: 959.4, + }, + { + x: '2018-09-29', + y: 1193.4, + }, + { + x: '2018-09-30', + y: 1017.9, + }, + { + x: '2018-10-01', + y: 1275.3, + }, + { + x: '2018-10-02', + y: 1170, + }, + ], + }, + { + name: 'bilka.dk', + data: [ + { + x: '2018-09-25', + y: 973.35, + }, + { + x: '2018-09-26', + y: 1147.16, + }, + { + x: '2018-09-27', + y: 1263.04, + }, + { + x: '2018-09-28', + y: 927, + }, + { + x: '2018-09-29', + y: 950.18, + }, + { + x: '2018-09-30', + y: 1123.99, + }, + { + x: '2018-10-01', + y: 1158.75, + }, + { + x: '2018-10-02', + y: 1158.75, + }, + ], + }, + { + name: 'hobbii.dk', + data: [ + { + x: '2018-09-25', + y: 963.9, + }, + { + x: '2018-09-26', + y: 1136.03, + }, + { + x: '2018-09-27', + y: 1216.35, + }, + { + x: '2018-09-28', + y: 1067.18, + }, + { + x: '2018-09-29', + y: 952.43, + }, + { + x: '2018-09-30', + y: 929.48, + }, + { + x: '2018-10-01', + y: 1204.88, + }, + { + x: '2018-10-02', + y: 1147.5, + }, + ], + }, +] diff --git a/frontend/src/i18n.js b/frontend/src/i18n.js index 98e4ec971..946507c82 100644 --- a/frontend/src/i18n.js +++ b/frontend/src/i18n.js @@ -4,6 +4,9 @@ import VueI18n from 'vue-i18n' import en from 'vee-validate/dist/locale/en' import de from 'vee-validate/dist/locale/de' +import enCharts from 'apexcharts/dist/locales/en' +import deCharts from 'apexcharts/dist/locales/de' + Vue.use(VueI18n) function loadLocaleMessages() { @@ -17,12 +20,14 @@ function loadLocaleMessages() { if (locale === 'de') { messages[locale] = { validations: de, + charts: deCharts, ...messages[locale], } } if (locale === 'en') { messages[locale] = { validations: en, + charts: enCharts, ...messages[locale], } } diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index ad0cf9335..93b70318c 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -102,8 +102,8 @@ "logout": "Abmelden", "members_area": "Mitgliederbereich", "message": "hallo gradido !!", - "privacy_policy": "Datenschutzerklärung", "overview": "Übersicht", + "privacy_policy": "Datenschutzerklärung", "send": "Senden", "settings": { "coinanimation": { diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 454f34dbd..d082a7133 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -102,8 +102,8 @@ "logout": "Logout", "members_area": "Member's area", "message": "hello gradido !!", - "privacy_policy": "Privacy policy", "overview": "Overview", + "privacy_policy": "Privacy policy", "send": "Send", "settings": { "coinanimation": { diff --git a/frontend/src/main.js b/frontend/src/main.js index f71441924..5ca40591e 100755 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -6,7 +6,7 @@ import { loadAllRules } from './validation-rules' import { ApolloClient, ApolloLink, InMemoryCache, HttpLink } from 'apollo-boost' import VueApollo from 'vue-apollo' import CONFIG from './config' -import VueCharts from 'vue-chartjs' +import VueApexCharts from 'vue-apexcharts' import { store } from './store/store' import router from './routes/router' @@ -57,6 +57,9 @@ router.beforeEach((to, from, next) => { } }) +Vue.use(VueApexCharts) +Vue.component('apexchart', VueApexCharts) + /* eslint-disable no-new */ new Vue({ el: '#app', @@ -64,6 +67,5 @@ new Vue({ store, i18n, apolloProvider, - VueCharts, render: (h) => h(App), }) diff --git a/frontend/src/views/Layout/DashboardLayout_gdd.spec.js b/frontend/src/views/Layout/DashboardLayout_gdd.spec.js index 6555d1dda..d737407dd 100644 --- a/frontend/src/views/Layout/DashboardLayout_gdd.spec.js +++ b/frontend/src/views/Layout/DashboardLayout_gdd.spec.js @@ -84,33 +84,43 @@ describe('DashboardLayoutGdd', () => { navbar = wrapper.findAll('ul.navbar-nav').at(0) }) - it('has three items in the navbar', () => { - expect(navbar.findAll('ul > a')).toHaveLength(3) + it('has four items in the navbar', () => { + expect(navbar.findAll('ul > a')).toHaveLength(4) }) - it('has first item "send" in navbar', () => { - expect(navbar.findAll('ul > a').at(0).text()).toEqual('send') + it('has first item "overview" in navbar', () => { + expect(navbar.findAll('ul > a').at(0).text()).toEqual('overview') }) - it('has first item "send" linked to overview in navbar', () => { + it('has first item "overview" linked to overview in navbar', () => { navbar.findAll('ul > a').at(0).trigger('click') - expect(wrapper.findComponent(RouterLinkStub).props().to).toBe('/overview') + expect(wrapper.findComponent(RouterLinkStub).props(0).to).toBe('/overview') }) - it('has second item "transactions" in navbar', () => { - expect(navbar.findAll('ul > a').at(1).text()).toEqual('transactions') + it('has second item "send" in navbar', () => { + expect(navbar.findAll('ul > a').at(1).text()).toEqual('send') }) - it('has second item "transactions" linked to transactions in navbar', async () => { - expect(wrapper.findAll('a').at(3).attributes('href')).toBe('/transactions') + it('has second item "send" linked to sendoverview in navbar', () => { + navbar.findAll('ul > a').at(1).trigger('click') + expect(wrapper.findAll('a').at(3).attributes('href')).toBe('/send') }) - it('has three items in the navbar', () => { - expect(navbar.findAll('ul > a')).toHaveLength(3) + it('has three item "transactions" in navbar', () => { + expect(navbar.findAll('ul > a').at(2).text()).toEqual('transactions') + }) + + it('has three item "transactions" linked to transactions in navbar', async () => { + navbar.findAll('ul > a').at(2).trigger('click') + expect(wrapper.findAll('a').at(5).attributes('href')).toBe('/transactions') + }) + + it('has three item "profil" in navbar', () => { + expect(navbar.findAll('ul > a').at(3).text()).toEqual('site.navbar.my-profil') }) it('has third item "My profile" linked to profile in navbar', async () => { - expect(wrapper.findAll('a').at(5).attributes('href')).toBe('/profile') + expect(wrapper.findAll('a').at(7).attributes('href')).toBe('/profile') }) it('has a link to the members area', () => { diff --git a/frontend/src/views/Pages/AccountOverview.spec.js b/frontend/src/views/Pages/AccountOverview.spec.js index 9d876f3ac..0ea413fa7 100644 --- a/frontend/src/views/Pages/AccountOverview.spec.js +++ b/frontend/src/views/Pages/AccountOverview.spec.js @@ -1,9 +1,6 @@ import { mount } from '@vue/test-utils' import AccountOverview from './AccountOverview' -const sendMock = jest.fn() -sendMock.mockResolvedValue('success') - const localVue = global.localVue window.scrollTo = jest.fn() @@ -11,26 +8,17 @@ window.scrollTo = jest.fn() describe('AccountOverview', () => { let wrapper - const propsData = { - balance: 123.45, - transactionCount: 1, - } - const mocks = { $t: jest.fn((t) => t), - $n: jest.fn((n) => String(n)), - $store: { - state: { - email: 'sender@example.org', - }, - }, - $apollo: { - mutate: sendMock, - }, + $n: jest.fn(), } const Wrapper = () => { - return mount(AccountOverview, { localVue, mocks, propsData }) + return mount(AccountOverview, { + localVue, + mocks, + stubs: ['apexchart'], + }) } describe('mount', () => { @@ -42,94 +30,8 @@ describe('AccountOverview', () => { expect(wrapper.find('div.gdd-status').exists()).toBeTruthy() }) - it('has a send field', () => { - expect(wrapper.find('div.gdd-send').exists()).toBeTruthy() - }) - it('has a transactions table', () => { expect(wrapper.find('div.gdd-transaction-list').exists()).toBeTruthy() }) - - describe('transaction form', () => { - it('steps forward in the dialog', async () => { - await wrapper.findComponent({ name: 'TransactionForm' }).vm.$emit('set-transaction', { - email: 'user@example.org', - amount: 23.45, - memo: 'Make the best of it!', - }) - expect(wrapper.findComponent({ name: 'TransactionConfirmation' }).exists()).toBeTruthy() - }) - }) - - describe('confirm transaction', () => { - beforeEach(() => { - wrapper.setData({ - currentTransactionStep: 1, - transactionData: { - email: 'user@example.org', - amount: 23.45, - memo: 'Make the best of it!', - }, - }) - }) - - it('resets the transaction process when on-reset is emitted', async () => { - await wrapper.findComponent({ name: 'TransactionConfirmation' }).vm.$emit('on-reset') - expect(wrapper.findComponent({ name: 'TransactionForm' }).exists()).toBeTruthy() - expect(wrapper.vm.transactionData).toEqual({ - email: '', - amount: 0, - memo: '', - }) - }) - - describe('transaction is confirmed and server response is success', () => { - beforeEach(async () => { - jest.clearAllMocks() - await wrapper - .findComponent({ name: 'TransactionConfirmation' }) - .vm.$emit('send-transaction') - }) - - it('calls the API when send-transaction is emitted', async () => { - expect(sendMock).toBeCalledWith( - expect.objectContaining({ - variables: { - email: 'user@example.org', - amount: 23.45, - memo: 'Make the best of it!', - }, - }), - ) - }) - - it('emits update-balance', () => { - expect(wrapper.emitted('update-balance')).toBeTruthy() - expect(wrapper.emitted('update-balance')).toEqual([[23.45]]) - }) - - it('shows the succes page', () => { - expect(wrapper.find('div.card-body').text()).toContain('form.send_transaction_success') - }) - }) - - describe('transaction is confirmed and server response is error', () => { - beforeEach(async () => { - jest.clearAllMocks() - sendMock.mockRejectedValue({ message: 'receiver not found' }) - await wrapper - .findComponent({ name: 'TransactionConfirmation' }) - .vm.$emit('send-transaction') - }) - - it('shows the error page', () => { - expect(wrapper.find('div.card-body').text()).toContain('form.send_transaction_error') - }) - - it('shows recipient not found', () => { - expect(wrapper.text()).toContain('transaction.receiverNotFound') - }) - }) - }) }) }) diff --git a/frontend/src/views/Pages/AccountOverview.vue b/frontend/src/views/Pages/AccountOverview.vue index 41d75a27c..1064fedaf 100644 --- a/frontend/src/views/Pages/AccountOverview.vue +++ b/frontend/src/views/Pages/AccountOverview.vue @@ -1,29 +1,56 @@ diff --git a/frontend/src/views/Pages/AccountOverview/GddStatus.vue b/frontend/src/views/Pages/AccountOverview/GddStatus.vue deleted file mode 100644 index 4ab675485..000000000 --- a/frontend/src/views/Pages/AccountOverview/GddStatus.vue +++ /dev/null @@ -1,30 +0,0 @@ - - - diff --git a/frontend/src/views/Pages/AccountOverview/GddStatus.spec.js b/frontend/src/views/Pages/GddGdtStatus.spec.js similarity index 70% rename from frontend/src/views/Pages/AccountOverview/GddStatus.spec.js rename to frontend/src/views/Pages/GddGdtStatus.spec.js index b414f4e93..02b8d8574 100644 --- a/frontend/src/views/Pages/AccountOverview/GddStatus.spec.js +++ b/frontend/src/views/Pages/GddGdtStatus.spec.js @@ -1,5 +1,5 @@ import { mount } from '@vue/test-utils' -import GddStatus from './GddStatus' +import GddStatus from './GddGdtStatus' const localVue = global.localVue @@ -26,11 +26,11 @@ describe('GddStatus', () => { describe('balance is loading', () => { it('it displays em-dash as the ammount of GDD', () => { - expect(wrapper.findAll('div.card-body').at(0).text()).toEqual('— GDD') + expect(wrapper.find('div.gdd-status-gdd').text()).toEqual('— GDD') }) it('it displays em-dash as the ammount of GDT', () => { - expect(wrapper.findAll('div.card-body').at(1).text()).toEqual('— GDT') + expect(wrapper.find('div.gdd-status-gdt').text()).toEqual('— GDT') }) }) @@ -42,11 +42,11 @@ describe('GddStatus', () => { }) it('it displays the ammount of GDD', () => { - expect(wrapper.findAll('div.card-body').at(0).text()).toEqual('1234 GDD') + expect(wrapper.find('div.gdd-status-gdd').text()).toEqual('1234 GDD') }) it('it displays the ammount of GDT', () => { - expect(wrapper.findAll('div.card-body').at(1).text()).toEqual('9876 GDT') + expect(wrapper.find('div.gdd-status-gdt').text()).toEqual('9876 GDT') }) }) }) diff --git a/frontend/src/views/Pages/GddGdtStatus.vue b/frontend/src/views/Pages/GddGdtStatus.vue new file mode 100644 index 000000000..11a3019c5 --- /dev/null +++ b/frontend/src/views/Pages/GddGdtStatus.vue @@ -0,0 +1,32 @@ + + + diff --git a/frontend/src/views/Pages/SendOverview.spec.js b/frontend/src/views/Pages/SendOverview.spec.js new file mode 100644 index 000000000..0bd43ba2d --- /dev/null +++ b/frontend/src/views/Pages/SendOverview.spec.js @@ -0,0 +1,135 @@ +import { mount } from '@vue/test-utils' +import SendOverview from './SendOverview' + +const sendMock = jest.fn() +sendMock.mockResolvedValue('success') + +const localVue = global.localVue + +// window.scrollTo = jest.fn() + +describe('SendOverview', () => { + let wrapper + + const propsData = { + balance: 123.45, + transactionCount: 1, + } + + const mocks = { + $t: jest.fn((t) => t), + $n: jest.fn((n) => String(n)), + $store: { + state: { + email: 'sender@example.org', + }, + }, + $apollo: { + mutate: sendMock, + }, + } + + const Wrapper = () => { + return mount(SendOverview, { localVue, mocks, propsData }) + } + + describe('mount', () => { + beforeEach(() => { + wrapper = Wrapper() + }) + + it('has a status GDD line', () => { + expect(wrapper.find('div.gdd-status-gdd').exists()).toBeTruthy() + }) + + it('has a send field', () => { + expect(wrapper.find('div.gdd-send').exists()).toBeTruthy() + }) + + // it('has a transactions table', () => { + // expect(wrapper.find('div.gdd-transaction-list').exists()).toBeTruthy() + // }) + + describe('transaction form', () => { + it('steps forward in the dialog', async () => { + await wrapper.findComponent({ name: 'TransactionForm' }).vm.$emit('set-transaction', { + email: 'user@example.org', + amount: 23.45, + memo: 'Make the best of it!', + }) + expect(wrapper.findComponent({ name: 'TransactionConfirmation' }).exists()).toBeTruthy() + }) + }) + + describe('confirm transaction', () => { + beforeEach(() => { + wrapper.setData({ + currentTransactionStep: 1, + transactionData: { + email: 'user@example.org', + amount: 23.45, + memo: 'Make the best of it!', + }, + }) + }) + + it('resets the transaction process when on-reset is emitted', async () => { + await wrapper.findComponent({ name: 'TransactionConfirmation' }).vm.$emit('on-reset') + expect(wrapper.findComponent({ name: 'TransactionForm' }).exists()).toBeTruthy() + expect(wrapper.vm.transactionData).toEqual({ + email: '', + amount: 0, + memo: '', + }) + }) + + describe('transaction is confirmed and server response is success', () => { + beforeEach(async () => { + jest.clearAllMocks() + await wrapper + .findComponent({ name: 'TransactionConfirmation' }) + .vm.$emit('send-transaction') + }) + + it('calls the API when send-transaction is emitted', async () => { + expect(sendMock).toBeCalledWith( + expect.objectContaining({ + variables: { + email: 'user@example.org', + amount: 23.45, + memo: 'Make the best of it!', + }, + }), + ) + }) + + it('emits update-balance', () => { + expect(wrapper.emitted('update-balance')).toBeTruthy() + expect(wrapper.emitted('update-balance')).toEqual([[23.45]]) + }) + + it('shows the succes page', () => { + expect(wrapper.find('div.card-body').text()).toContain('form.send_transaction_success') + }) + }) + + describe('transaction is confirmed and server response is error', () => { + beforeEach(async () => { + jest.clearAllMocks() + sendMock.mockRejectedValue({ message: 'receiver not found' }) + await wrapper + .findComponent({ name: 'TransactionConfirmation' }) + .vm.$emit('send-transaction') + }) + + it('shows the error page', () => { + expect(wrapper.find('div.card-body').text()).toContain('form.send_transaction_error') + }) + + it('shows recipient not found', () => { + expect(wrapper.text()).toContain('transaction.receiverNotFound') + }) + }) + }) + }) +}) diff --git a/frontend/src/views/Pages/SendOverview.vue b/frontend/src/views/Pages/SendOverview.vue index d90dc6adc..aaa16b550 100644 --- a/frontend/src/views/Pages/SendOverview.vue +++ b/frontend/src/views/Pages/SendOverview.vue @@ -1,12 +1,18 @@ From db6cea4cbdb03e077962808af8d7c41574ff660a Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Fri, 22 Oct 2021 08:58:37 +0200 Subject: [PATCH 31/35] only one describe block on top level --- .../GdtTransactionList.spec.js | 125 +++++++----------- 1 file changed, 51 insertions(+), 74 deletions(-) diff --git a/frontend/src/views/Pages/AccountOverview/GdtTransactionList.spec.js b/frontend/src/views/Pages/AccountOverview/GdtTransactionList.spec.js index 359260db1..77507cb69 100644 --- a/frontend/src/views/Pages/AccountOverview/GdtTransactionList.spec.js +++ b/frontend/src/views/Pages/AccountOverview/GdtTransactionList.spec.js @@ -4,7 +4,7 @@ import GdtTransactionList from './GdtTransactionList' const localVue = global.localVue -const apolloMockNull = jest.fn().mockResolvedValue({ +const apolloMock = jest.fn().mockResolvedValue({ data: { listGDTEntries: { count: 0, @@ -13,48 +13,6 @@ const apolloMockNull = jest.fn().mockResolvedValue({ }, }) -const apolloMock = jest.fn().mockResolvedValue({ - data: { - listGDTEntries: { - count: 4, - gdtEntries: [ - { - amount: 100, - gdt: 1700, - factor: 17, - comment: '', - date: '2021-05-02T17:20:11+00:00', - gdtEntryType: GdtEntryType.FORM, - }, - { - amount: 1810, - gdt: 362, - factor: 0.2, - comment: 'Dezember 20', - date: '2020-12-31T12:00:00+00:00', - gdtEntryType: GdtEntryType.GLOBAL_MODIFICATOR, - }, - { - amount: 100, - gdt: 1700, - factor: 17, - comment: '', - date: '2020-05-07T17:00:00+00:00', - gdtEntryType: GdtEntryType.FORM, - }, - { - amount: 100, - gdt: 110, - factor: 22, - comment: '', - date: '2020-04-10T13:28:00+00:00', - gdtEntryType: GdtEntryType.ELOPAGE_PUBLISHER, - }, - ], - }, - }, -}) - const toastErrorMock = jest.fn() const windowScrollToMock = jest.fn() @@ -82,7 +40,7 @@ describe('GdtTransactionList ', () => { error: toastErrorMock, }, $apollo: { - query: apolloMockNull, + query: apolloMock, }, } @@ -100,40 +58,59 @@ describe('GdtTransactionList ', () => { }) it('links to https://gradido.net/en/memberships/ when clicking', async () => { - const link = 'https://gradido.net/' + state.language + '/memberships/' - expect(wrapper.find('.gdt-funding').attributes('href')).toBe(link) + expect(wrapper.find('.gdt-funding').attributes('href')).toBe( + 'https://gradido.net/' + state.language + '/memberships/', + ) }) }) -}) - -describe('GdtTransactionList', () => { - let wrapper - - const mocks = { - $store: { - state, - commit: jest.fn(), - }, - $i18n: { - locale: 'en', - }, - $t: jest.fn((t) => t), - $n: jest.fn((n) => n), - $d: jest.fn((d) => d), - $toasted: { - error: toastErrorMock, - }, - $apollo: { - query: apolloMock, - }, - } - - const Wrapper = () => { - return mount(GdtTransactionList, { localVue, mocks }) - } describe('mount - When transactions are loaded', () => { beforeEach(() => { + apolloMock.mockResolvedValue({ + data: { + listGDTEntries: { + count: 4, + gdtEntries: [ + { + id: 1, + amount: 100, + gdt: 1700, + factor: 17, + comment: '', + date: '2021-05-02T17:20:11+00:00', + gdtEntryType: GdtEntryType.FORM, + }, + { + id: 2, + amount: 1810, + gdt: 362, + factor: 0.2, + comment: 'Dezember 20', + date: '2020-12-31T12:00:00+00:00', + gdtEntryType: GdtEntryType.GLOBAL_MODIFICATOR, + }, + { + id: 3, + amount: 100, + gdt: 1700, + factor: 17, + comment: '', + date: '2020-05-07T17:00:00+00:00', + gdtEntryType: GdtEntryType.FORM, + }, + { + id: 4, + amount: 100, + gdt: 110, + factor: 22, + comment: '', + date: '2020-04-10T13:28:00+00:00', + gdtEntryType: GdtEntryType.ELOPAGE_PUBLISHER, + }, + ], + }, + }, + }) wrapper = Wrapper() }) @@ -141,7 +118,7 @@ describe('GdtTransactionList', () => { expect(wrapper.find('div.gdt-transaction-list').exists()).toBeTruthy() }) - it('renders the not funding button ', () => { + it('does not render the funding button ', () => { expect(wrapper.find('.gdt-funding').exists()).toBe(false) }) From ba3b1dc69a3c372cb0eaf9f0a1a32bf3cf5a4b9b Mon Sep 17 00:00:00 2001 From: elweyn Date: Sat, 23 Oct 2021 15:30:14 +0200 Subject: [PATCH 32/35] Withdrew blue border of safari on the gdd list items. --- .../src/views/Pages/AccountOverview/GddTransactionList.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/views/Pages/AccountOverview/GddTransactionList.vue b/frontend/src/views/Pages/AccountOverview/GddTransactionList.vue index 11dc6ee00..1e24c14d0 100644 --- a/frontend/src/views/Pages/AccountOverview/GddTransactionList.vue +++ b/frontend/src/views/Pages/AccountOverview/GddTransactionList.vue @@ -198,4 +198,8 @@ export default { padding-left: 0px; padding-right: 0px; } + +.gdd-transaction-list-item { + outline: none !important; +} From 4ff13d3959750e925c76ef543170d882014b23f9 Mon Sep 17 00:00:00 2001 From: elweyn Date: Sat, 23 Oct 2021 15:30:25 +0200 Subject: [PATCH 33/35] Withdrew blue border of safari on the gdt list items. --- .../src/views/Pages/AccountOverview/GdtTransactionList.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/views/Pages/AccountOverview/GdtTransactionList.vue b/frontend/src/views/Pages/AccountOverview/GdtTransactionList.vue index f727d6297..a96e592aa 100644 --- a/frontend/src/views/Pages/AccountOverview/GdtTransactionList.vue +++ b/frontend/src/views/Pages/AccountOverview/GdtTransactionList.vue @@ -102,4 +102,8 @@ export default { .nav-tabs .nav-item.show .nav-link { background-color: #f8f9fe38; } + +.gdt-transaction-list-item { + outline: none !important; +} From 0402bdbc86d7ec62d5debd3e3e99fa591e1d72bf Mon Sep 17 00:00:00 2001 From: elweyn Date: Sat, 23 Oct 2021 15:30:58 +0200 Subject: [PATCH 34/35] Withdrew blue border of safari on the GDD and GDT tab. --- frontend/src/views/Pages/UserProfileTransactionList.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/views/Pages/UserProfileTransactionList.vue b/frontend/src/views/Pages/UserProfileTransactionList.vue index 5f52bb540..f9240008d 100644 --- a/frontend/src/views/Pages/UserProfileTransactionList.vue +++ b/frontend/src/views/Pages/UserProfileTransactionList.vue @@ -62,4 +62,8 @@ export default { background-color: aquamarine; font-size: larger; } + +.nav-tabs > li > a { + outline: none !important; +} From f482eb7db6e7ff8ccc9d1841b1689bfd6f85ecae Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 26 Oct 2021 07:52:49 +0200 Subject: [PATCH 35/35] mock console error only in the test for the error --- frontend/src/components/Transaction.spec.js | 10 ++++------ frontend/src/components/TransactionCollapse.spec.js | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/frontend/src/components/Transaction.spec.js b/frontend/src/components/Transaction.spec.js index d0bb009b7..aaad023e0 100644 --- a/frontend/src/components/Transaction.spec.js +++ b/frontend/src/components/Transaction.spec.js @@ -2,16 +2,10 @@ import { mount } from '@vue/test-utils' import Transaction from './Transaction' import Vue from 'vue' -// disable throwing Errors on warnings to catch the warning -Vue.config.warnHandler = (w) => {} - const localVue = global.localVue const consoleErrorMock = jest.fn() -// eslint-disable-next-line no-console -console.error = consoleErrorMock - describe('Transaction', () => { let wrapper @@ -43,6 +37,10 @@ describe('Transaction', () => { describe('no valid GDT entry type', () => { beforeEach(async () => { + // disable throwing Errors on warnings to catch the warning + Vue.config.warnHandler = (w) => {} + // eslint-disable-next-line no-console + console.error = consoleErrorMock await wrapper.setProps({ gdtEntryType: 'NOT_VALID' }) }) diff --git a/frontend/src/components/TransactionCollapse.spec.js b/frontend/src/components/TransactionCollapse.spec.js index c25bb5aad..58385700a 100644 --- a/frontend/src/components/TransactionCollapse.spec.js +++ b/frontend/src/components/TransactionCollapse.spec.js @@ -4,16 +4,10 @@ import { GdtEntryType } from '../graphql/enums' import Vue from 'vue' -// disable throwing Errors on warnings to catch the warning -Vue.config.warnHandler = (w) => {} - const localVue = global.localVue const consoleErrorMock = jest.fn() -// eslint-disable-next-line no-console -console.error = consoleErrorMock - describe('TransactionCollapse', () => { let wrapper @@ -28,6 +22,10 @@ describe('TransactionCollapse', () => { describe('no valid GDT entry type', () => { beforeEach(async () => { + // disable throwing Errors on warnings to catch the warning + Vue.config.warnHandler = (w) => {} + // eslint-disable-next-line no-console + console.error = consoleErrorMock const propsData = { amount: 100, gdt: 110,