diff --git a/admin/src/components/ContributionLink.spec.js b/admin/src/components/ContributionLink/ContributionLink.spec.js
similarity index 100%
rename from admin/src/components/ContributionLink.spec.js
rename to admin/src/components/ContributionLink/ContributionLink.spec.js
diff --git a/admin/src/components/ContributionLink.vue b/admin/src/components/ContributionLink/ContributionLink.vue
similarity index 92%
rename from admin/src/components/ContributionLink.vue
rename to admin/src/components/ContributionLink/ContributionLink.vue
index 0ae9c76b2..a2d171d56 100644
--- a/admin/src/components/ContributionLink.vue
+++ b/admin/src/components/ContributionLink/ContributionLink.vue
@@ -36,8 +36,8 @@
diff --git a/admin/src/pages/Overview.spec.js b/admin/src/pages/Overview.spec.js
index 1861c5330..affd018a7 100644
--- a/admin/src/pages/Overview.spec.js
+++ b/admin/src/pages/Overview.spec.js
@@ -1,6 +1,5 @@
import { mount } from '@vue/test-utils'
import Overview from './Overview.vue'
-import { listContributionLinks } from '@/graphql/listContributionLinks.js'
import { communityStatistics } from '@/graphql/communityStatistics.js'
import { listUnconfirmedContributions } from '@/graphql/listUnconfirmedContributions.js'
@@ -36,27 +35,6 @@ const apolloQueryMock = jest
},
},
})
- .mockResolvedValueOnce({
- data: {
- listContributionLinks: {
- links: [
- {
- id: 1,
- name: 'Meditation',
- memo: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut l',
- amount: '200',
- validFrom: '2022-04-01',
- validTo: '2022-08-01',
- cycle: 'täglich',
- maxPerCycle: '3',
- maxAmountPerMonth: 0,
- link: 'https://localhost/redeem/CL-1a2345678',
- },
- ],
- count: 1,
- },
- },
- })
.mockResolvedValue({
data: {
listUnconfirmedContributions: [
@@ -118,14 +96,6 @@ describe('Overview', () => {
)
})
- it('calls listContributionLinks', () => {
- expect(apolloQueryMock).toBeCalledWith(
- expect.objectContaining({
- query: listContributionLinks,
- }),
- )
- })
-
it('commits three pending creations to store', () => {
expect(storeCommitMock).toBeCalledWith('setOpenCreations', 3)
})
diff --git a/admin/src/pages/Overview.vue b/admin/src/pages/Overview.vue
index cfa247b8e..57bf7ff8c 100644
--- a/admin/src/pages/Overview.vue
+++ b/admin/src/pages/Overview.vue
@@ -28,31 +28,21 @@
-
diff --git a/admin/src/router/router.test.js b/admin/src/router/router.test.js
index eb9b646cb..bf2e724d2 100644
--- a/admin/src/router/router.test.js
+++ b/admin/src/router/router.test.js
@@ -45,7 +45,7 @@ describe('router', () => {
describe('routes', () => {
it('has seven routes defined', () => {
- expect(routes).toHaveLength(7)
+ expect(routes).toHaveLength(8)
})
it('has "/overview" as default', async () => {
@@ -81,6 +81,13 @@ describe('router', () => {
})
})
+ describe('contribution-link', () => {
+ it('loads the "ContributionLink" component', async () => {
+ const component = await routes.find((r) => r.path === '/contribution-link').component()
+ expect(component.default.name).toBe('ContributionLinks')
+ })
+ })
+
describe('not found page', () => {
it('renders the "NotFound" component', async () => {
const component = await routes.find((r) => r.path === '*').component()
diff --git a/admin/src/router/routes.js b/admin/src/router/routes.js
index 72e7b1ac5..caf1030a1 100644
--- a/admin/src/router/routes.js
+++ b/admin/src/router/routes.js
@@ -23,6 +23,10 @@ const routes = [
path: '/creation-confirm',
component: () => import('@/pages/CreationConfirm.vue'),
},
+ {
+ path: '/contribution-link',
+ component: () => import('@/pages/ContributionLink.vue'),
+ },
{
path: '*',
component: () => import('@/components/NotFoundPage.vue'),