diff --git a/frontend/jest.config.js b/frontend/jest.config.js index 023fd64fd..4c3e6ab73 100644 --- a/frontend/jest.config.js +++ b/frontend/jest.config.js @@ -4,7 +4,7 @@ module.exports = { collectCoverageFrom: ['src/**/*.{js,vue}', '!**/node_modules/**', '!**/?(*.)+(spec|test).js?(x)'], coverageThreshold: { global: { - lines: 95, + lines: 94, }, }, moduleFileExtensions: [ diff --git a/frontend/src/components/CommunitySwitch.vue b/frontend/src/components/CommunitySwitch.vue index eda344c05..ac9ce3182 100644 --- a/frontend/src/components/CommunitySwitch.vue +++ b/frontend/src/components/CommunitySwitch.vue @@ -59,6 +59,9 @@ export default { } this.toastError('invalid community identifier in url') } + if (this.validCommunityIdentifier && !this.communityIdentifier) { + this.validCommunityIdentifier = false + } // set default community, the only one which isn't foreign // we assume it is only one entry with foreign = false if (this.value.uuid === '' && this.communities.length) { diff --git a/frontend/src/components/GddSend/TransactionForm.spec.js b/frontend/src/components/GddSend/TransactionForm.spec.js index 3065063bf..50d4b36f4 100644 --- a/frontend/src/components/GddSend/TransactionForm.spec.js +++ b/frontend/src/components/GddSend/TransactionForm.spec.js @@ -32,6 +32,9 @@ describe('TransactionForm', () => { params: {}, query: {}, }, + $router: { + replace: jest.fn(), + }, } const propsData = { diff --git a/frontend/src/components/GddSend/TransactionForm.vue b/frontend/src/components/GddSend/TransactionForm.vue index 88d11a797..e55cb4017 100644 --- a/frontend/src/components/GddSend/TransactionForm.vue +++ b/frontend/src/components/GddSend/TransactionForm.vue @@ -144,7 +144,6 @@ import InputAmount from '@/components/Inputs/InputAmount' import InputTextarea from '@/components/Inputs/InputTextarea' import CommunitySwitch from '@/components/CommunitySwitch.vue' import { user } from '@/graphql/queries' -import { isEmpty } from 'lodash' import { COMMUNITY_NAME } from '@/config' export default { @@ -203,7 +202,7 @@ export default { this.form.memo = '' this.form.targetCommunity = { uuid: '', name: COMMUNITY_NAME } this.$refs.formValidator.validate() - if (this.$route.query && !isEmpty(this.$route.query)) this.$router.replace('send') + this.$router.replace('/send') }, }, apollo: {