diff --git a/frontend/src/components/Transactions/TransactionLinkSummary.spec.js b/frontend/src/components/Transactions/TransactionLinkSummary.spec.js
index fe949bd61..d0086ceab 100644
--- a/frontend/src/components/Transactions/TransactionLinkSummary.spec.js
+++ b/frontend/src/components/Transactions/TransactionLinkSummary.spec.js
@@ -17,6 +17,12 @@ const mocks = {
$apollo: {
query: apolloQueryMock,
},
+ $store: {
+ state: {
+ firstName: 'Bibi',
+ lastName: 'Bloxberg',
+ },
+ },
}
const propsData = {
@@ -102,10 +108,10 @@ describe('TransactionLinkSummary', () => {
describe('click on transaction links', () => {
beforeEach(async () => {
- wrapper.find('div.transaction-slot-link').trigger('click')
+ wrapper.find('div.row').trigger('click')
})
- it.skip('calls the API to get the list transaction links', () => {
+ it('calls the API to get the list transaction links', () => {
expect(apolloQueryMock).toBeCalledWith({
query: listTransactionLinks,
variables: {
@@ -115,14 +121,14 @@ describe('TransactionLinkSummary', () => {
})
})
- it.skip('has four transactionLinks', () => {
+ it('has four transactionLinks', () => {
expect(wrapper.vm.transactionLinks).toHaveLength(4)
})
describe('close transaction link details', () => {
beforeEach(() => {
jest.clearAllMocks()
- wrapper.find('div.transaction-slot-link').trigger('click')
+ wrapper.find('div.row').trigger('click')
})
it('does not call the API', () => {
@@ -136,10 +142,10 @@ describe('TransactionLinkSummary', () => {
describe('reopen transaction link details', () => {
beforeEach(() => {
jest.clearAllMocks()
- wrapper.find('div.transaction-slot-link').trigger('click')
+ wrapper.find('div.row').trigger('click')
})
- it.skip('calls the API to get the list transaction links', () => {
+ it('calls the API to get the list transaction links', () => {
expect(apolloQueryMock).toBeCalledWith({
query: listTransactionLinks,
variables: {
@@ -149,7 +155,7 @@ describe('TransactionLinkSummary', () => {
})
})
- it.skip('has four transactionLinks', () => {
+ it('has four transactionLinks', () => {
expect(wrapper.vm.transactionLinks).toHaveLength(4)
})
})
@@ -215,7 +221,7 @@ describe('TransactionLinkSummary', () => {
})
it('has eight transactionLinks', () => {
- expect(wrapper.vm.transactionLinks).toHaveLength(4)
+ expect(wrapper.vm.transactionLinks).toHaveLength(8)
})
it('loads more transaction links', () => {
@@ -230,19 +236,19 @@ describe('TransactionLinkSummary', () => {
describe('close transaction link list', () => {
beforeEach(async () => {
- wrapper.find('div.transaction-slot-link').trigger('click')
+ wrapper.find('div.row').trigger('click')
})
describe('reopen transaction link list', () => {
beforeEach(async () => {
jest.clearAllMocks()
- wrapper.find('div.transaction-slot-link').trigger('click')
+ wrapper.find('div.row').trigger('click')
})
- it.skip('calls the API once', () => {
+ it('calls the API once', () => {
expect(apolloQueryMock).toBeCalledTimes(1)
})
- it.skip('calls the API with current page one', () => {
+ it('calls the API with current page one', () => {
expect(apolloQueryMock).toBeCalledWith({
query: listTransactionLinks,
variables: {
@@ -289,10 +295,10 @@ describe('TransactionLinkSummary', () => {
})
})
- describe.skip('loads transaction links with error', () => {
+ describe('loads transaction links with error', () => {
beforeEach(() => {
apolloQueryMock.mockRejectedValue({ message: 'OUCH!' })
- wrapper.find('div.transaction-slot-link').trigger('click')
+ wrapper.find('div.row').trigger('click')
})
it('toasts an error message', () => {
diff --git a/frontend/src/graphql/queries.js b/frontend/src/graphql/queries.js
index 3b1186a0c..e199a3730 100644
--- a/frontend/src/graphql/queries.js
+++ b/frontend/src/graphql/queries.js
@@ -183,6 +183,8 @@ export const listContributions = gql`
deletedAt
state
messagesCount
+ deniedAt
+ deniedBy
}
}
}
@@ -202,6 +204,10 @@ export const listAllContributions = gql`
contributionDate
confirmedAt
confirmedBy
+ state
+ messagesCount
+ deniedAt
+ deniedBy
}
}
}
diff --git a/frontend/src/layouts/DashboardLayout.vue b/frontend/src/layouts/DashboardLayout.vue
index ae1e0b75e..11b9e3060 100755
--- a/frontend/src/layouts/DashboardLayout.vue
+++ b/frontend/src/layouts/DashboardLayout.vue
@@ -3,7 +3,7 @@
-
+
@@ -125,14 +125,13 @@
:transactions="transactions"
:transactionCount="transactionCount"
:transactionLinkCount="transactionLinkCount"
- @set-tunneled-email="setTunneledEmail"
>
@@ -167,14 +166,13 @@
:transactions="transactions"
:transactionCount="transactionCount"
:transactionLinkCount="transactionLinkCount"
- @set-tunneled-email="setTunneledEmail"
>
diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json
index 5c0ee9f96..a51b48e37 100644
--- a/frontend/src/locales/de.json
+++ b/frontend/src/locales/de.json
@@ -30,21 +30,22 @@
"noOpenContributionLinkText": "Zur Zeit gibt es keine automatischen Schöpfungen.",
"openContributionLinks": "Öffentliche Beitrags-Linkliste",
"openContributionLinkText": "Folgende {count} automatische Schöpfungen werden zur Zeit durch die Gemeinschaft „{name}“ bereitgestellt.",
- "submitContribution": "schreiben"
+ "submitContribution": "Schreiben"
},
"communityInfo": "Gemeinschaft Information",
"contact": "Kontakt",
"contribution": {
"activity": "Tätigkeit",
"alert": {
- "answerQuestion": "Bitte beantworte die Rückfrage!",
+ "answerQuestion": "Bitte beantworte diese Rückfrage.",
+ "answerQuestionToast": "Du hast eine Rückfrage auf einen Beitrag. Bitte antworte auf diese.",
"communityNoteList": "Hier findest du alle eingereichten und bestätigten Beiträge von allen Mitgliedern aus dieser Gemeinschaft.",
"confirm": "bestätigt",
"deleted": "gelöscht",
+ "denied": "abgelehnt",
"in_progress": "Es gibt eine Rückfrage der Moderatoren.",
"myContributionNoteList": "Eingereichte Beiträge, die noch nicht bestätigt wurden, kannst du jederzeit bearbeiten oder löschen.",
- "pending": "Eingereicht und wartet auf Bestätigung",
- "rejected": "abgelehnt"
+ "pending": "Eingereicht und wartet auf Bestätigung"
},
"delete": "Beitrag löschen! Bist du sicher?",
"deleted": "Der Beitrag wurde gelöscht! Wird aber sichtbar bleiben.",
diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json
index 7a210f6a0..ce65ac9af 100644
--- a/frontend/src/locales/en.json
+++ b/frontend/src/locales/en.json
@@ -30,21 +30,22 @@
"noOpenContributionLinkText": "Currently there are no automatic creations.",
"openContributionLinks": "Open contribution-link list",
"openContributionLinkText": "The following {count} automatic creations are currently provided by the \"{name}\" community.",
- "submitContribution": "writing"
+ "submitContribution": "Contribute"
},
"communityInfo": "Community Information",
"contact": "Contact",
"contribution": {
"activity": "Activity",
"alert": {
- "answerQuestion": "Please answer the question",
+ "answerQuestion": "Please answer the question.",
+ "answerQuestionToast": "You have a question about a post. Please reply to it.",
"communityNoteList": "Here you will find all submitted and confirmed contributions from all members of this community.",
"confirm": "confirmed",
"deleted": "deleted",
+ "denied": "rejected",
"in_progress": "There is a question from the moderators.",
"myContributionNoteList": "You can edit or delete entries that have not yet been confirmed at any time.",
- "pending": "Submitted and waiting for confirmation",
- "rejected": "deleted"
+ "pending": "Submitted and waiting for confirmation"
},
"delete": "Delete Contribution! Are you sure?",
"deleted": "The contribution has been deleted! But it will remain visible.",
@@ -126,7 +127,7 @@
"firstname": "Firstname",
"from": "from",
"generate_now": "Generate now",
- "hours": "Horas",
+ "hours": "Hours",
"lastname": "Lastname",
"memo": "Message",
"message": "Message",
diff --git a/frontend/src/locales/es.json b/frontend/src/locales/es.json
index 0377dcb4e..9441a10a2 100644
--- a/frontend/src/locales/es.json
+++ b/frontend/src/locales/es.json
@@ -39,10 +39,10 @@
"answerQuestion": "Por favor, contesta las preguntas",
"communityNoteList": "Aquí encontrarás todas las contribuciones enviadas y confirmadas de todos los miembros de esta comunidad.",
"confirm": "confirmado",
+ "denied": "rechazado",
"in_progress": "Hay una pregunta de los moderatores.",
"myContributionNoteList": "Puedes editar o eliminar las contribuciones enviadas que aún no han sido confirmadas en cualquier momento.",
- "pending": "Enviado y a la espera de confirmación",
- "rejected": "rechazado"
+ "pending": "Enviado y a la espera de confirmación"
},
"date": "Contribución para:",
"delete": "Eliminar la contribución. ¿Estás seguro?",
diff --git a/frontend/src/locales/fr.json b/frontend/src/locales/fr.json
index e911af300..9e2c11fc5 100644
--- a/frontend/src/locales/fr.json
+++ b/frontend/src/locales/fr.json
@@ -1,4 +1,6 @@
{
+ "(": "(",
+ ")": ")",
"100": "100%",
"1000thanks": "1000 mercis d'être avec nous!",
"125": "125%",
@@ -20,29 +22,29 @@
"community": {
"choose-another-community": "Choisissez une autre communauté",
"community": "Communauté",
+ "communityMember": "Vous etes un membre actif",
"continue-to-registration": "Continuez l´inscription",
- "current-community": "Communauté actuelle",
- "members": "Membres",
"moderator": "Modérateur",
"moderators": "Modérateurs",
- "myContributions": "Mes contributions aux biens communs",
+ "myContributions": "Mes contributions",
+ "noOpenContributionLinkText": "Currently there are no automatic creations.",
"openContributionLinks": "liste de liens de contribution publique",
"openContributionLinkText": "Les {count} créations automatiques suivantes sont actuellement fournies par la communauté \"{name}\".",
- "other-communities": "Autres communautés",
- "statistic": "Statistiques",
- "submitContribution": "écrire",
- "switch-to-this-community": "Passer à cette communauté"
+ "submitContribution": "Contribuer"
},
+ "communityInfo": "Information communauté^^",
+ "contact": "Contact",
"contribution": {
"activity": "Activité",
"alert": {
"answerQuestion": "S'il te plais répond à la question",
"communityNoteList": "Vous trouverez ci-contre toutes les contributions versées et certifiées de tous les membres de cette communauté.",
- "confirm": " Approuvé",
+ "confirm": "Approuvé",
+ "deleted": "Supprimé",
+ "denied": "supprimé",
"in_progress": "Il y a une question du modérateur.",
"myContributionNoteList": "À tout moment vous pouvez éditer ou supprimer les données qui n´ont pas été confirmées.",
- "pending": "Inscription en attente de validation",
- "rejected": "supprimé"
+ "pending": "Inscription en attente de validation"
},
"date": "Contribution pour:",
"delete": "Supprimer la contribution! Êtes-vous sûr?",
@@ -65,6 +67,8 @@
"thanksYouWith": "vous remercie avec",
"unique": "(unique)"
},
+ "contributionText": "Texte de la contribution",
+ "creation": "Création",
"decay": {
"before_startblock_transaction": "Cette transaction n´est pas péremptoire.",
"calculation_decay": "Calcul de la décroissance",
@@ -84,6 +88,7 @@
}
},
"delete": "Supprimer",
+ "edit": "modifier",
"em-dash": "—",
"error": {
"email-already-sent": "Nous vous avons déjà envoyé un email il y a moins de 10 minutes.",
@@ -121,7 +126,7 @@
"firstname": " Prénom",
"from": "de",
"generate_now": "Produire maintenant",
- "hours": "Uren",
+ "hours": "Heures",
"lastname": "Nom",
"memo": "Note",
"message": "Message",
@@ -147,7 +152,8 @@
"to": "à",
"to1": "à",
"validation": {
- "gddSendAmount": "L´espace {_field_} doit comprendre un nombre entre {min} et {max} avec un maximum de deux chiffres après la virgule",
+ "gddCreationTime": "Le champ {_field_} doit comprendre un nombre entre {min} et {max} avec un maximum de une décimale.",
+ "gddSendAmount": "Le champ {_field_} doit comprendre un nombre entre {min} et {max} avec un maximum de deux chiffres après la virgule",
"is-not": "Vous ne pouvez pas vous envoyer de Gradido à vous-même",
"usernmae-regex": "Le nom d´utilisateur doit commencer par une lettre, suivi d´au moins deux caractères alphanumériques.",
"usernmae-unique": "Ce nom d´utilisateur est déjà pris."
@@ -155,13 +161,13 @@
"your_amount": "Votre montant"
},
"GDD": "GDD",
+ "gddKonto": "Compte GDD",
"gdd_per_link": {
"choose-amount": "Sélectionnez le montant que vous souhaitez envoyer via lien. Vous pouvez également joindre un message. Cliquez sur ‘créer maintenant’ pour établir un lien que vous pourrez partager.",
"copy-link": "Copier le lien",
"copy-link-with-text": "Copier le lien et le texte",
"created": "Le lien a été créé!",
"credit-your-gradido": "Pour l´accréditation du Gradido, cliquer sur le lien!",
- "decay-14-day": "Perte sur 14 jours",
"delete-the-link": "Supprimer le lien?",
"deleted": "Le lien a été supprimé!",
"expiredOn": "A expiré le",
@@ -188,6 +194,7 @@
"validUntil": "Valide jusqu´au",
"validUntilDate": "Le lien est valide jusqu´au {date}."
},
+ "GDT": "GDT",
"gdt": {
"calculation": "Calcul de Gradido Transform",
"contribution": "Contribution",
@@ -199,22 +206,25 @@
"funding": "Aux contributions au financement",
"gdt": "Gradido Transform",
"gdt-received": "Gradido Transform (GDT) perçu",
+ "gdtKonto": "Compte GDT",
"no-transactions": "Vous ne possédez pas encore Gradido Transform (GDT).",
"not-reachable": "Le Serveur GDT n´est pas accessible.",
"publisher": "Un membre que vous avez référé a apporté un contribution",
"raise": "Augmentation",
"recruited-member": "Membre invité"
},
+ "h": "h",
"language": "Langage",
"link-load": "Enregistrer le dernier lien | Enregistrer les derniers {n} liens | Enregistrer plus de {n} liens",
"login": "Connexion",
"math": {
- "aprox": "~",
"asterisk": "*",
"equal": "=",
"minus": "−",
"pipe": "|"
},
+ "maxReached": "Max. atteint",
+ "member": "Membre",
"message": {
"activateEmail": "Votre compte n´a pas encore été activé. Veuillez vérifier vos emails et cliquer sur le lien d´activation ou faites la demande d´un nouveau lien en utilisant la page qui permet de générer un nouveau mot de passe.",
"checkEmail": "Votre email a bien été vérifié. Vous pouvez vous enregistrer maintenant.",
@@ -231,13 +241,22 @@
"community": "Communauté",
"info": "Information",
"logout": "Déconnexion",
- "members_area": "Partie réservée aux membres",
"overview": "Aperçu",
- "profile": "Mon profile",
"send": "Envoyer",
+ "settings": "Configuration",
"support": "Aide",
"transactions": "Transactions"
},
+ "openHours": "Heures ouverte",
+ "pageTitle": {
+ "community": "Ma communauté",
+ "gdt": "Vos transactions GDT",
+ "information": "{community}",
+ "overview": "Bienvenue {name}",
+ "send": "Envoyé Gradidos",
+ "settings": "Configuration",
+ "transactions": "Vos transactions"
+ },
"qrCode": "QR Code",
"send_gdd": "Envoyer GDD",
"send_per_link": "Envoyer GDD via lien",
@@ -248,6 +267,8 @@
"warningText": "Êtes-vous toujours connecté?"
},
"settings": {
+ "hideAmountGDD": "Votre montant GDD est caché.",
+ "hideAmountGDT": "Votre montant GDT est caché.",
"language": {
"changeLanguage": "Changer la langue",
"de": "Deutsch",
@@ -280,7 +301,9 @@
"text": "Sauvegardez votre nouveau mot de passe maintenant, que vous pourrez utiliser pour vous connecter à votre compte Gradido dans le futur."
},
"subtitle": "Si vous avez oublié votre mot de passe, vous pouvez le réinitialiser ici."
- }
+ },
+ "showAmountGDD": "Votre montant GDD est visible.",
+ "showAmountGDT": "Votre montant GDT est visible."
},
"signin": "S´identifier",
"signup": "S´inscrire",
@@ -302,11 +325,8 @@
"uppercase": "Une lettre majuscule requise."
}
},
- "statistic": {
- "totalGradidoAvailable": "GDD total en circulation",
- "totalGradidoCreated": "GDD total puisé",
- "totalGradidoDecayed": "Total de GDD écoulé"
- },
+ "status": "Statu",
+ "submitted": "Envoyé",
"success": "Avec succès",
"time": {
"days": "Jours",
@@ -318,8 +338,7 @@
"years": "Année"
},
"transaction": {
- "gdd-text": "Transactions Gradido",
- "gdt-text": "Transactions de GradidoTransform",
+ "lastTransactions": "Dernières transactions",
"nullTransactions": "Vous n´avez pas encore de transaction effectuée sur votre compte.",
"receiverDeleted": "Le compte du destinataire n´existe plus",
"receiverNotFound": "Destinataire inconnu",
diff --git a/frontend/src/locales/nl.json b/frontend/src/locales/nl.json
index ed1181e4c..0ac052c47 100644
--- a/frontend/src/locales/nl.json
+++ b/frontend/src/locales/nl.json
@@ -39,10 +39,10 @@
"answerQuestion": "Please answer the question",
"communityNoteList": "Hier vind je alle ingediende en bevestigde bijdragen van alle leden uit deze gemeenschap.",
"confirm": "bevestigt",
+ "denied": "afgewezen",
"in_progress": "There is a question from the moderators.",
"myContributionNoteList": "Ingediende bijdragen, die nog niet bevestigd zijn, kun je op elk moment wijzigen of verwijderen.",
- "pending": "Ingediend en wacht op bevestiging",
- "rejected": "afgewezen"
+ "pending": "Ingediend en wacht op bevestiging"
},
"date": "Bijdrage voor:",
"delete": "Bijdrage verwijderen! Weet je het zeker?",
diff --git a/frontend/src/locales/tr.json b/frontend/src/locales/tr.json
index 33642f3c6..4bfc7145b 100644
--- a/frontend/src/locales/tr.json
+++ b/frontend/src/locales/tr.json
@@ -34,10 +34,10 @@
"alert": {
"communityNoteList": "Burada, bu topluluğun tüm üyelerinden gönderilen ve onaylanan bütün faydalı hizmetleri bulacaksın.",
"confirm": "onaylandı",
+ "denied": "reddedildi",
"myContributionNoteList": "Bildirmiş olduğun henüz onaylanmamış olan faaliyetleri istediğin zaman düzenleyebilir veya silebilirsin.",
"myContributionNoteSupport": "Yakın zamanda moderatörlerle aranda bir diyalog olasılığı olacak. Şu anda herhangi bir sorun yaşıyorsan, lütfen destek hattına başvur.",
- "pending": "Gönderildi ve onay bekleniyor",
- "rejected": "reddedildi"
+ "pending": "Gönderildi ve onay bekleniyor"
},
"date": "Hizmet:",
"delete": "Hizmeti sil! Emin misin?",
diff --git a/frontend/src/mixins/copyLinks.js b/frontend/src/mixins/copyLinks.js
index ac6be95c5..1e339c49f 100644
--- a/frontend/src/mixins/copyLinks.js
+++ b/frontend/src/mixins/copyLinks.js
@@ -24,15 +24,7 @@ export const copyLinks = {
},
copyLinkWithText() {
navigator.clipboard
- .writeText(
- `${this.link}
-${this.$store.state.firstName} ${this.$t('transaction-link.send_you')} ${this.amount} Gradido.
-"${this.memo}"
-${this.$t('gdd_per_link.credit-your-gradido')} ${this.$t('gdd_per_link.validUntilDate', {
- date: this.$d(new Date(this.validUntil), 'short'),
- })}
-${this.$t('gdd_per_link.link-hint')}`,
- )
+ .writeText(this.linkText)
.then(() => {
this.toastSuccess(this.$t('gdd_per_link.link-and-text-copied'))
})
@@ -42,4 +34,15 @@ ${this.$t('gdd_per_link.link-hint')}`,
})
},
},
+ computed: {
+ linkText() {
+ return `${this.link}
+${this.$store.state.firstName} ${this.$t('transaction-link.send_you')} ${this.amount} Gradido.
+"${this.memo}"
+${this.$t('gdd_per_link.credit-your-gradido')} ${this.$t('gdd_per_link.validUntilDate', {
+ date: this.$d(new Date(this.validUntil), 'short'),
+ })}
+${this.$t('gdd_per_link.link-hint')}`
+ },
+ },
}
diff --git a/frontend/src/pages/Community.spec.js b/frontend/src/pages/Community.spec.js
index 41ecc75e9..ecfc01716 100644
--- a/frontend/src/pages/Community.spec.js
+++ b/frontend/src/pages/Community.spec.js
@@ -1,58 +1,59 @@
import { mount } from '@vue/test-utils'
import Community from './Community'
-import { toastErrorSpy, toastSuccessSpy } from '@test/testSetup'
+import { toastErrorSpy, toastSuccessSpy, toastInfoSpy } from '@test/testSetup'
import { createContribution, updateContribution, deleteContribution } from '@/graphql/mutations'
-import { listContributions, listAllContributions } from '@/graphql/queries'
+import { listContributions, listAllContributions, openCreations } from '@/graphql/queries'
+import { createMockClient } from 'mock-apollo-client'
+import VueApollo from 'vue-apollo'
+
+const mockClient = createMockClient()
+const apolloProvider = new VueApollo({
+ defaultClient: mockClient,
+})
const localVue = global.localVue
+localVue.use(VueApollo)
const mockStoreDispach = jest.fn()
-const apolloQueryMock = jest.fn()
-const apolloMutationMock = jest.fn()
-const apolloRefetchMock = jest.fn()
+const routerPushMock = jest.fn()
describe('Community', () => {
let wrapper
- const mocks = {
- $t: jest.fn((t) => t),
- $d: jest.fn((d) => d),
- $apollo: {
- query: apolloQueryMock,
- mutate: apolloMutationMock,
- queries: {
- OpenCreations: {
- refetch: apolloRefetchMock,
+ mockClient.setRequestHandler(
+ openCreations,
+ jest
+ .fn()
+ .mockRejectedValueOnce({ message: 'Open Creations failed!' })
+ .mockResolvedValue({
+ data: {
+ openCreations: [
+ {
+ month: 0,
+ year: 2023,
+ amount: '1000',
+ },
+ {
+ month: 1,
+ year: 2023,
+ amount: '1000',
+ },
+ {
+ month: 2,
+ year: 2023,
+ amount: '1000',
+ },
+ ],
},
- },
- },
- $store: {
- dispatch: mockStoreDispach,
- state: {
- creation: ['1000', '1000', '1000'],
- },
- },
- $i18n: {
- locale: 'en',
- },
- $router: {
- push: jest.fn(),
- },
- $route: {
- hash: 'my',
- },
- }
+ }),
+ )
- const Wrapper = () => {
- return mount(Community, {
- localVue,
- mocks,
- })
- }
-
- describe('mount', () => {
- beforeEach(() => {
- apolloQueryMock.mockResolvedValue({
+ mockClient.setRequestHandler(
+ listContributions,
+ jest
+ .fn()
+ .mockRejectedValueOnce({ message: 'List Contributions failed!' })
+ .mockResolvedValue({
data: {
listContributions: {
contributionList: [
@@ -64,10 +65,40 @@ describe('Community', () => {
deletedAt: null,
confirmedBy: null,
confirmedAt: null,
+ firstName: 'Bibi',
+ contributionDate: '2022-07-15T08:47:06.000Z',
+ lastName: 'Bloxberg',
+ state: 'IN_PROGRESS',
+ messagesCount: 0,
+ },
+ {
+ id: 1550,
+ amount: '200',
+ memo: 'Fleisig, fleisig am Arbeiten gewesen',
+ createdAt: '2022-07-15T08:47:06.000Z',
+ deletedAt: null,
+ confirmedBy: null,
+ confirmedAt: null,
+ firstName: 'Bibi',
+ contributionDate: '2022-06-15T08:47:06.000Z',
+ lastName: 'Bloxberg',
+ state: 'CONFIRMED',
+ messagesCount: 0,
},
],
contributionCount: 1,
},
+ },
+ }),
+ )
+
+ mockClient.setRequestHandler(
+ listAllContributions,
+ jest
+ .fn()
+ .mockRejectedValueOnce({ message: 'List All Contributions failed!' })
+ .mockResolvedValue({
+ data: {
listAllContributions: {
contributionList: [
{
@@ -75,29 +106,137 @@ describe('Community', () => {
amount: '200',
memo: 'Fleisig, fleisig am Arbeiten mein lieber Freund, 50 Zeichen sind viel',
createdAt: '2022-07-15T08:47:06.000Z',
+ contributionDate: '2022-07-15T08:47:06.000Z',
deletedAt: null,
confirmedBy: null,
confirmedAt: null,
+ firstName: 'Bibi',
+ lastName: 'Bloxberg',
+ },
+ {
+ id: 1550,
+ amount: '200',
+ memo: 'Fleisig, fleisig am Arbeiten gewesen',
+ createdAt: '2022-07-15T08:47:06.000Z',
+ deletedAt: null,
+ confirmedBy: null,
+ confirmedAt: null,
+ firstName: 'Bibi',
+ contributionDate: '2022-06-15T08:47:06.000Z',
+ lastName: 'Bloxberg',
+ messagesCount: 0,
},
{
id: 1556,
amount: '400',
memo: 'Ein anderer lieber Freund ist auch sehr felißig am Arbeiten!!!!',
createdAt: '2022-07-16T08:47:06.000Z',
+ contributionDate: '2022-07-16T08:47:06.000Z',
deletedAt: null,
confirmedBy: null,
confirmedAt: null,
+ firstName: 'Bob',
+ lastName: 'der Baumeister',
},
],
- contributionCount: 2,
+ contributionCount: 3,
},
},
- })
+ }),
+ )
+
+ mockClient.setRequestHandler(
+ createContribution,
+ jest
+ .fn()
+ .mockRejectedValueOnce({ message: 'Create Contribution failed!' })
+ .mockResolvedValue({
+ data: {
+ createContribution: true,
+ },
+ }),
+ )
+
+ mockClient.setRequestHandler(
+ updateContribution,
+ jest
+ .fn()
+ .mockRejectedValueOnce({ message: 'Update Contribution failed!' })
+ .mockResolvedValue({
+ data: {
+ updateContribution: true,
+ },
+ }),
+ )
+
+ mockClient.setRequestHandler(
+ deleteContribution,
+ jest
+ .fn()
+ .mockRejectedValueOnce({ message: 'Delete Contribution failed!' })
+ .mockResolvedValue({
+ data: {
+ deleteContribution: true,
+ },
+ }),
+ )
+
+ const mocks = {
+ $t: jest.fn((t) => t),
+ $d: jest.fn((d) => d),
+ $store: {
+ dispatch: mockStoreDispach,
+ state: {
+ user: {
+ firstName: 'Bibi',
+ lastName: 'Bloxberg',
+ },
+ },
+ },
+ $i18n: {
+ locale: 'en',
+ },
+ $router: {
+ push: routerPushMock,
+ },
+ $route: {
+ hash: '#edit',
+ },
+ }
+
+ const Wrapper = () => {
+ return mount(Community, {
+ localVue,
+ mocks,
+ apolloProvider,
+ })
+ }
+
+ let apolloMutateSpy
+ let refetchContributionsSpy
+ let refetchAllContributionsSpy
+ let refetchOpenCreationsSpy
+
+ describe('mount', () => {
+ beforeEach(() => {
+ jest.clearAllMocks()
wrapper = Wrapper()
+ apolloMutateSpy = jest.spyOn(wrapper.vm.$apollo, 'mutate')
+ refetchContributionsSpy = jest.spyOn(wrapper.vm.$apollo.queries.ListContributions, 'refetch')
+ refetchAllContributionsSpy = jest.spyOn(
+ wrapper.vm.$apollo.queries.ListAllContributions,
+ 'refetch',
+ )
+ refetchOpenCreationsSpy = jest.spyOn(wrapper.vm.$apollo.queries.OpenCreations, 'refetch')
})
- it('has a DIV .community-page', () => {
- expect(wrapper.find('div.community-page').exists()).toBe(true)
+ describe('server response for queries is error', () => {
+ it('toasts three errors', () => {
+ expect(toastErrorSpy).toBeCalledTimes(3)
+ expect(toastErrorSpy).toBeCalledWith('Open Creations failed!')
+ expect(toastErrorSpy).toBeCalledWith('List Contributions failed!')
+ expect(toastErrorSpy).toBeCalledWith('List All Contributions failed!')
+ })
})
describe('tabs', () => {
@@ -105,60 +244,49 @@ describe('Community', () => {
expect(wrapper.findAll('div[role="tabpanel"]')).toHaveLength(3)
})
- it.todo('check for correct tabIndex if state is "IN_PROGRESS" or not')
+ it('check for correct tabIndex if state is "IN_PROGRESS" or not', () => {
+ expect(routerPushMock).toBeCalledWith({ path: '/community#my' })
+ })
+
+ it('toasts an info', () => {
+ expect(toastInfoSpy).toBeCalledWith('contribution.alert.answerQuestionToast')
+ })
})
describe('API calls after creation', () => {
+ it('has a DIV .community-page', () => {
+ expect(wrapper.find('div.community-page').exists()).toBe(true)
+ })
+
it('emits update transactions', () => {
expect(wrapper.emitted('update-transactions')).toEqual([[0]])
})
-
- it('queries list of own contributions', () => {
- expect(apolloQueryMock).toBeCalledWith({
- fetchPolicy: 'no-cache',
- query: listContributions,
- variables: {
- currentPage: 1,
- pageSize: 25,
- },
- })
- })
-
- it('queries list of all contributions', () => {
- expect(apolloQueryMock).toBeCalledWith({
- fetchPolicy: 'no-cache',
- query: listAllContributions,
- variables: {
- currentPage: 1,
- pageSize: 25,
- },
- })
- })
-
- describe('server response is error', () => {
- beforeEach(() => {
- jest.clearAllMocks()
- apolloQueryMock.mockRejectedValue({ message: 'Ups' })
- wrapper = Wrapper()
- })
-
- it('toasts two errors', () => {
- expect(toastErrorSpy).toBeCalledTimes(2)
- expect(toastErrorSpy).toBeCalledWith('Ups')
- })
- })
})
- describe('set contrubtion', () => {
+ describe('save contrubtion', () => {
+ describe('with error', () => {
+ const now = new Date().toISOString()
+ beforeEach(async () => {
+ await wrapper.setData({
+ form: {
+ id: null,
+ date: now,
+ memo: 'Mein Beitrag zur Gemeinschaft für diesen Monat ...',
+ amount: '200',
+ },
+ })
+ await wrapper.find('form').trigger('submit')
+ })
+
+ it('toasts the error message', () => {
+ expect(toastErrorSpy).toBeCalledWith('Create Contribution failed!')
+ })
+ })
+
describe('with success', () => {
const now = new Date().toISOString()
beforeEach(async () => {
jest.clearAllMocks()
- apolloMutationMock.mockResolvedValue({
- data: {
- createContribution: true,
- },
- })
await wrapper.setData({
form: {
id: null,
@@ -171,7 +299,7 @@ describe('Community', () => {
})
it('calls the create contribution mutation', () => {
- expect(apolloMutationMock).toBeCalledWith({
+ expect(apolloMutateSpy).toBeCalledWith({
fetchPolicy: 'no-cache',
mutation: createContribution,
variables: {
@@ -187,62 +315,49 @@ describe('Community', () => {
})
it('updates the contribution list', () => {
- expect(apolloQueryMock).toBeCalledWith({
- fetchPolicy: 'no-cache',
- query: listContributions,
- variables: {
- currentPage: 1,
- pageSize: 25,
- },
- })
+ expect(refetchContributionsSpy).toBeCalled()
})
- it('verifies the login (to get the new creations available)', () => {
- expect(apolloRefetchMock).toBeCalled()
+ it('updates the all contribution list', () => {
+ expect(refetchAllContributionsSpy).toBeCalled()
})
- it('set all data to the default values)', () => {
+ it('updates the open creations', () => {
+ expect(refetchOpenCreationsSpy).toBeCalled()
+ })
+
+ it('sets all data to the default values)', () => {
expect(wrapper.vm.form.id).toBe(null)
expect(wrapper.vm.form.date).toBe('')
expect(wrapper.vm.form.memo).toBe('')
expect(wrapper.vm.form.amount).toBe('')
})
})
-
- describe('with error', () => {
- const now = new Date().toISOString()
- beforeEach(async () => {
- jest.clearAllMocks()
- apolloMutationMock.mockRejectedValue({
- message: 'Ouch!',
- })
- await wrapper.setData({
- form: {
- id: null,
- date: now,
- memo: 'Mein Beitrag zur Gemeinschaft für diesen Monat ...',
- amount: '200',
- },
- })
- await wrapper.find('form').trigger('submit')
- })
-
- it('toasts the error message', () => {
- expect(toastErrorSpy).toBeCalledWith('Ouch!')
- })
- })
})
describe('update contrubtion', () => {
+ describe('with error', () => {
+ const now = new Date().toISOString()
+ beforeEach(async () => {
+ await wrapper
+ .findComponent({ name: 'ContributionForm' })
+ .vm.$emit('update-contribution', {
+ id: 2,
+ date: now,
+ memo: 'Mein Beitrag zur Gemeinschaft für diesen Monat ...',
+ amount: '400',
+ })
+ })
+
+ it('toasts the error message', () => {
+ expect(toastErrorSpy).toBeCalledWith('Update Contribution failed!')
+ })
+ })
+
describe('with success', () => {
const now = new Date().toISOString()
beforeEach(async () => {
jest.clearAllMocks()
- apolloMutationMock.mockResolvedValue({
- data: {
- updateContribution: true,
- },
- })
await wrapper
.findComponent({ name: 'ContributionForm' })
.vm.$emit('update-contribution', {
@@ -254,7 +369,7 @@ describe('Community', () => {
})
it('calls the update contribution mutation', () => {
- expect(apolloMutationMock).toBeCalledWith({
+ expect(apolloMutateSpy).toBeCalledWith({
fetchPolicy: 'no-cache',
mutation: updateContribution,
variables: {
@@ -271,40 +386,15 @@ describe('Community', () => {
})
it('updates the contribution list', () => {
- expect(apolloQueryMock).toBeCalledWith({
- fetchPolicy: 'no-cache',
- query: listContributions,
- variables: {
- currentPage: 1,
- pageSize: 25,
- },
- })
+ expect(refetchContributionsSpy).toBeCalled()
})
- it('verifies the login (to get the new creations available)', () => {
- expect(apolloRefetchMock).toBeCalled()
- })
- })
-
- describe('with error', () => {
- const now = new Date().toISOString()
- beforeEach(async () => {
- jest.clearAllMocks()
- apolloMutationMock.mockRejectedValue({
- message: 'Oh No!',
- })
- await wrapper
- .findComponent({ name: 'ContributionForm' })
- .vm.$emit('update-contribution', {
- id: 2,
- date: now,
- memo: 'Mein Beitrag zur Gemeinschaft für diesen Monat ...',
- amount: '400',
- })
+ it('updates the all contribution list', () => {
+ expect(refetchAllContributionsSpy).toBeCalled()
})
- it('toasts the error message', () => {
- expect(toastErrorSpy).toBeCalledWith('Oh No!')
+ it('updates the open creations', () => {
+ expect(refetchOpenCreationsSpy).toBeCalled()
})
})
})
@@ -314,22 +404,28 @@ describe('Community', () => {
beforeEach(async () => {
await wrapper.setData({ tabIndex: 1 })
- contributionListComponent = await wrapper.findComponent({ name: 'ContributionList' })
+ contributionListComponent = wrapper.findComponent({ name: 'ContributionList' })
+ })
+
+ describe('with error', () => {
+ beforeEach(async () => {
+ jest.clearAllMocks()
+ contributionListComponent.vm.$emit('delete-contribution', { id: 2 })
+ })
+
+ it('toasts the error message', () => {
+ expect(toastErrorSpy).toBeCalledWith('Delete Contribution failed!')
+ })
})
describe('with success', () => {
beforeEach(async () => {
jest.clearAllMocks()
- apolloMutationMock.mockResolvedValue({
- data: {
- deleteContribution: true,
- },
- })
- contributionListComponent.vm.$emit('delete-contribution', { id: 2 })
+ await contributionListComponent.vm.$emit('delete-contribution', { id: 2 })
})
it('calls the API', () => {
- expect(apolloMutationMock).toBeCalledWith({
+ expect(apolloMutateSpy).toBeCalledWith({
fetchPolicy: 'no-cache',
mutation: deleteContribution,
variables: {
@@ -343,37 +439,20 @@ describe('Community', () => {
})
it('updates the contribution list', () => {
- expect(apolloQueryMock).toBeCalledWith({
- fetchPolicy: 'no-cache',
- query: listContributions,
- variables: {
- currentPage: 1,
- pageSize: 25,
- },
- })
+ expect(refetchContributionsSpy).toBeCalled()
})
- it('verifies the login (to get the new creations available)', () => {
- expect(apolloRefetchMock).toBeCalled()
- })
- })
-
- describe('with error', () => {
- beforeEach(async () => {
- jest.clearAllMocks()
- apolloMutationMock.mockRejectedValue({
- message: 'Oh my god!',
- })
- contributionListComponent.vm.$emit('delete-contribution', { id: 2 })
+ it('updates the all contribution list', () => {
+ expect(refetchAllContributionsSpy).toBeCalled()
})
- it('toasts the error message', () => {
- expect(toastErrorSpy).toBeCalledWith('Oh my god!')
+ it('updates the open creations', () => {
+ expect(refetchOpenCreationsSpy).toBeCalled()
})
})
})
- describe.skip('update contribution form', () => {
+ describe('update contribution form', () => {
const now = new Date().toISOString()
beforeEach(async () => {
await wrapper.setData({ tabIndex: 1 })
@@ -391,12 +470,58 @@ describe('Community', () => {
expect(wrapper.vm.form.id).toBe(2)
expect(wrapper.vm.form.date).toBe(now)
expect(wrapper.vm.form.memo).toBe('Mein Beitrag zur Gemeinschaft für diesen Monat ...')
- expect(wrapper.vm.form.amount).toBe('400')
+ expect(wrapper.vm.form.amount).toBe('400.00')
})
it('sets tab index back to 0', () => {
expect(wrapper.vm.tabIndex).toBe(0)
})
})
+
+ describe('update list all contributions', () => {
+ beforeEach(async () => {
+ jest.clearAllMocks()
+ await wrapper.setData({ tabIndex: 2 })
+ await wrapper
+ .findAllComponents({ name: 'ContributionList' })
+ .at(1)
+ .vm.$emit('update-list-contributions', {
+ currentPage: 2,
+ pageSize: 5,
+ })
+ })
+
+ it('updates page size and current page', () => {
+ expect(wrapper.vm.pageSizeAll).toBe(5)
+ expect(wrapper.vm.currentPageAll).toBe(2)
+ })
+
+ it('updates the all contribution list', () => {
+ expect(refetchAllContributionsSpy).toBeCalled()
+ })
+ })
+
+ describe('update list contributions', () => {
+ beforeEach(async () => {
+ jest.clearAllMocks()
+ await wrapper.setData({ tabIndex: 1 })
+ await wrapper
+ .findAllComponents({ name: 'ContributionList' })
+ .at(0)
+ .vm.$emit('update-list-contributions', {
+ currentPage: 2,
+ pageSize: 5,
+ })
+ })
+
+ it('updates page size and current page', () => {
+ expect(wrapper.vm.pageSize).toBe(5)
+ expect(wrapper.vm.currentPage).toBe(2)
+ })
+
+ it('updates the all contribution list', () => {
+ expect(refetchContributionsSpy).toBeCalled()
+ })
+ })
})
})
diff --git a/frontend/src/pages/Community.vue b/frontend/src/pages/Community.vue
index 13aad1a72..5b771eac9 100644
--- a/frontend/src/pages/Community.vue
+++ b/frontend/src/pages/Community.vue
@@ -10,7 +10,7 @@
/>
item.state === 'IN_PROGRESS')) {
+ this.tabIndex = 1
+ if (this.$route.hash !== '#my') {
+ this.$router.push({ path: '/community#my' })
+ }
+ this.toastInfo(this.$t('contribution.alert.answerQuestionToast'))
+ }
+ },
+ error({ message }) {
+ this.toastError(message)
+ },
+ },
},
watch: {
$route(to, from) {
@@ -160,7 +206,12 @@ export default {
this.$root.$emit('bv::toggle::collapse', value.id)
})
},
- setContribution(data) {
+ refetchData() {
+ this.$apollo.queries.ListAllContributions.refetch()
+ this.$apollo.queries.ListContributions.refetch()
+ this.$apollo.queries.OpenCreations.refetch()
+ },
+ saveContribution(data) {
this.$apollo
.mutate({
fetchPolicy: 'no-cache',
@@ -173,15 +224,7 @@ export default {
})
.then((result) => {
this.toastSuccess(this.$t('contribution.submitted'))
- this.updateListContributions({
- currentPage: this.currentPage,
- pageSize: this.pageSize,
- })
- this.updateListAllContributions({
- currentPage: this.currentPage,
- pageSize: this.pageSize,
- })
- this.$apollo.queries.OpenCreations.refetch()
+ this.refetchData()
})
.catch((err) => {
this.toastError(err.message)
@@ -201,15 +244,7 @@ export default {
})
.then((result) => {
this.toastSuccess(this.$t('contribution.updated'))
- this.updateListContributions({
- currentPage: this.currentPage,
- pageSize: this.pageSize,
- })
- this.updateListAllContributions({
- currentPage: this.currentPage,
- pageSize: this.pageSize,
- })
- this.$apollo.queries.OpenCreations.refetch()
+ this.refetchData()
})
.catch((err) => {
this.toastError(err.message)
@@ -226,68 +261,21 @@ export default {
})
.then((result) => {
this.toastSuccess(this.$t('contribution.deleted'))
- this.updateListContributions({
- currentPage: this.currentPage,
- pageSize: this.pageSize,
- })
- this.updateListAllContributions({
- currentPage: this.currentPage,
- pageSize: this.pageSize,
- })
- this.$apollo.queries.OpenCreations.refetch()
+ this.refetchData()
})
.catch((err) => {
this.toastError(err.message)
})
},
updateListAllContributions(pagination) {
- this.$apollo
- .query({
- fetchPolicy: 'no-cache',
- query: listAllContributions,
- variables: {
- currentPage: pagination.currentPage,
- pageSize: pagination.pageSize,
- },
- })
- .then((result) => {
- const {
- data: { listAllContributions },
- } = result
- this.contributionCountAll = listAllContributions.contributionCount
- this.itemsAll = listAllContributions.contributionList
- })
- .catch((err) => {
- this.toastError(err.message)
- })
+ this.currentPageAll = pagination.currentPage
+ this.pageSizeAll = pagination.pageSize
+ this.$apollo.queries.ListAllContributions.refetch()
},
updateListContributions(pagination) {
- this.$apollo
- .query({
- fetchPolicy: 'no-cache',
- query: listContributions,
- variables: {
- currentPage: pagination.currentPage,
- pageSize: pagination.pageSize,
- },
- })
- .then((result) => {
- const {
- data: { listContributions },
- } = result
- this.contributionCount = listContributions.contributionCount
- this.items = listContributions.contributionList
- if (this.items.find((item) => item.state === 'IN_PROGRESS')) {
- this.tabIndex = 1
- if (this.$route.hash !== '#my') {
- this.$router.push({ path: '/community#my' })
- }
- this.toastInfo('Du hast eine Rückfrage auf eine Contribution. Bitte beantworte diese!')
- }
- })
- .catch((err) => {
- this.toastError(err.message)
- })
+ this.currentPage = pagination.currentPage
+ this.pageSize = pagination.pageSize
+ this.$apollo.queries.ListContributions.refetch()
},
updateContributionForm(item) {
this.form.id = item.id
@@ -306,16 +294,7 @@ export default {
this.items.find((item) => item.id === id).state = 'PENDING'
},
},
-
created() {
- this.updateListContributions({
- currentPage: this.currentPage,
- pageSize: this.pageSize,
- })
- this.updateListAllContributions({
- currentPage: this.currentPage,
- pageSize: this.pageSize,
- })
this.updateTransactions(0)
this.tabIndex = 1
this.$router.push({ path: '/community#my' })
diff --git a/frontend/src/pages/ForgotPassword.spec.js b/frontend/src/pages/ForgotPassword.spec.js
index f4b74e555..c5b25bf1c 100644
--- a/frontend/src/pages/ForgotPassword.spec.js
+++ b/frontend/src/pages/ForgotPassword.spec.js
@@ -1,4 +1,4 @@
-import { mount, RouterLinkStub } from '@vue/test-utils'
+import { mount } from '@vue/test-utils'
import flushPromises from 'flush-promises'
import { toastErrorSpy } from '@test/testSetup'
import ForgotPassword from './ForgotPassword'
@@ -7,43 +7,28 @@ const mockAPIcall = jest.fn()
const localVue = global.localVue
-const mockRouterPush = jest.fn()
-
-const stubs = {
- RouterLink: RouterLinkStub,
-}
-
-const createMockObject = (comingFrom) => {
- return {
- localVue,
- mocks: {
- $t: jest.fn((t) => t),
- $router: {
- push: mockRouterPush,
- },
- $apollo: {
- mutate: mockAPIcall,
- },
- $route: {
- params: {
- comingFrom,
- },
- },
+const mocks = {
+ $t: jest.fn((t) => t),
+ $apollo: {
+ mutate: mockAPIcall,
+ },
+ $route: {
+ params: {
+ comingFrom: '',
},
- stubs,
- }
+ },
}
describe('ForgotPassword', () => {
let wrapper
- const Wrapper = (functionN) => {
- return mount(ForgotPassword, functionN)
+ const Wrapper = () => {
+ return mount(ForgotPassword, { localVue, mocks })
}
describe('mount', () => {
beforeEach(() => {
- wrapper = Wrapper(createMockObject())
+ wrapper = Wrapper()
})
it('renders the component', () => {
@@ -110,12 +95,6 @@ describe('ForgotPassword', () => {
expect(wrapper.find('.test-message-button').attributes('href')).toBe('/login')
})
- it.skip('click redirects to "/login"', async () => {
- // wrapper.find('.test-message-button').trigger('click')
- // await wrapper.vm.$nextTick()
- expect(mockRouterPush).toBeCalledWith('/login')
- })
-
it('toasts a standard error message', () => {
expect(toastErrorSpy).toBeCalledWith('error.email-already-sent')
})
@@ -144,13 +123,20 @@ describe('ForgotPassword', () => {
it('button link redirects to "/login"', () => {
expect(wrapper.find('.test-message-button').attributes('href')).toBe('/login')
})
-
- it.skip('click redirects to "/login"', () => {
- // expect(mockRouterPush).toBeCalledWith('/login')
- })
})
})
})
})
+
+ describe('route has coming from ', () => {
+ beforeEach(() => {
+ mocks.$route.params.comingFrom = 'coming from'
+ wrapper = Wrapper()
+ })
+
+ it('changes subtitle', () => {
+ expect(wrapper.vm.subtitle).toBe('settings.password.resend_subtitle')
+ })
+ })
})
})
diff --git a/frontend/src/pages/Send.spec.js b/frontend/src/pages/Send.spec.js
index 63715a6a2..651ba9c4d 100644
--- a/frontend/src/pages/Send.spec.js
+++ b/frontend/src/pages/Send.spec.js
@@ -254,7 +254,7 @@ describe('Send', () => {
describe('copy link with success', () => {
beforeEach(async () => {
navigatorClipboardMock.mockResolvedValue()
- await wrapper.find('.pointer').trigger('click')
+ await wrapper.find('div[data-test="copyLink"]').trigger('click')
})
it('should call clipboard.writeText', () => {
@@ -270,7 +270,7 @@ describe('Send', () => {
describe('copy link with error', () => {
beforeEach(async () => {
navigatorClipboardMock.mockRejectedValue()
- await wrapper.find('.clipboard-copy').find('.btn-secondary').trigger('click')
+ await wrapper.find('div[data-test="copyLink"]').trigger('click')
})
it('toasts error message', () => {
@@ -292,7 +292,7 @@ describe('Send', () => {
describe('copy link and text with success', () => {
beforeEach(async () => {
navigatorClipboardMock.mockResolvedValue()
- await wrapper.findAll('button').at(0).trigger('click')
+ await wrapper.find('div[data-test="copyLinkWithText"]').trigger('click')
})
it('should call clipboard.writeText', () => {
@@ -312,7 +312,7 @@ describe('Send', () => {
describe('copy link and text with error', () => {
beforeEach(async () => {
navigatorClipboardMock.mockRejectedValue()
- await wrapper.findAll('button').at(0).trigger('click')
+ await wrapper.find('div[data-test="copyLinkWithText"]').trigger('click')
})
it('toasts error message', () => {
diff --git a/frontend/src/pages/Transactions.vue b/frontend/src/pages/Transactions.vue
index 40d883886..a4e805aed 100644
--- a/frontend/src/pages/Transactions.vue
+++ b/frontend/src/pages/Transactions.vue
@@ -15,6 +15,7 @@
:transactionLinkCount="transactionLinkCount"
:transactions="transactions"
:showPagination="true"
+ :pageSize="pageSize"
@update-transactions="updateTransactions"
v-on="$listeners"
/>
@@ -90,6 +91,11 @@ export default {
this.updateGdt()
}
},
+ gdt() {
+ if (this.gdt) {
+ this.updateGdt()
+ }
+ },
},
}
diff --git a/frontend/test/testSetup.js b/frontend/test/testSetup.js
index 06e84b269..196f38fcd 100644
--- a/frontend/test/testSetup.js
+++ b/frontend/test/testSetup.js
@@ -22,6 +22,7 @@ import { loadFilters } from '@/filters/amount'
import { toasters } from '@/mixins/toaster'
export const toastErrorSpy = jest.spyOn(toasters.methods, 'toastError')
export const toastSuccessSpy = jest.spyOn(toasters.methods, 'toastSuccess')
+export const toastInfoSpy = jest.spyOn(toasters.methods, 'toastInfo')
Object.keys(rules).forEach((rule) => {
extend(rule, {
@@ -70,6 +71,6 @@ console.warn = (m) => {
}
// throw errors for vue warnings to force the programmers to take care about warnings
-Vue.config.warnHandler = (w) => {
+Vue.config.warnHandler = async (w) => {
throw new Error(w)
}
diff --git a/frontend/yarn.lock b/frontend/yarn.lock
index f374ac7bd..4abfbddf4 100644
--- a/frontend/yarn.lock
+++ b/frontend/yarn.lock
@@ -2,6 +2,25 @@
# yarn lockfile v1
+"@apollo/client@^3.7.4":
+ version "3.7.4"
+ resolved "https://registry.yarnpkg.com/@apollo/client/-/client-3.7.4.tgz#28c3fb7f89365ccaf185bc8b51860041f37629b3"
+ integrity sha512-bgiCKRmLSBImX4JRrw8NjqGo0AQE/mowCdHX1PJp2r5zIXrJx0UeaAYmx1qJY69Oz/KR7SKlLt4xK+bOP1jx7A==
+ dependencies:
+ "@graphql-typed-document-node/core" "^3.1.1"
+ "@wry/context" "^0.7.0"
+ "@wry/equality" "^0.5.0"
+ "@wry/trie" "^0.3.0"
+ graphql-tag "^2.12.6"
+ hoist-non-react-statics "^3.3.2"
+ optimism "^0.16.1"
+ prop-types "^15.7.2"
+ response-iterator "^0.2.6"
+ symbol-observable "^4.0.0"
+ ts-invariant "^0.10.3"
+ tslib "^2.3.0"
+ zen-observable-ts "^1.2.5"
+
"@babel/code-frame@7.12.11":
version "7.12.11"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f"
@@ -1904,6 +1923,11 @@
minimatch "^3.0.4"
strip-json-comments "^3.1.1"
+"@graphql-typed-document-node/core@^3.1.1":
+ version "3.1.1"
+ resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.1.1.tgz#076d78ce99822258cf813ecc1e7fa460fa74d052"
+ integrity sha512-NQ17ii0rK1b34VZonlmT2QMJFI70m0TRwbknO/ihlbatXyaktDhN/98vBiUU6kNBPljqGqyIrl2T4nY2RpFANg==
+
"@hapi/address@2.x.x":
version "2.1.4"
resolved "https://registry.yarnpkg.com/@hapi/address/-/address-2.1.4.tgz#5d67ed43f3fd41a69d4b9ff7b56e7c0d1d0a81e5"
@@ -3159,6 +3183,13 @@
"@types/node" ">=6"
tslib "^1.9.3"
+"@wry/context@^0.7.0":
+ version "0.7.0"
+ resolved "https://registry.yarnpkg.com/@wry/context/-/context-0.7.0.tgz#be88e22c0ddf62aeb0ae9f95c3d90932c619a5c8"
+ integrity sha512-LcDAiYWRtwAoSOArfk7cuYvFXytxfVrdX7yxoUmK7pPITLk5jYh2F8knCwS7LjgYL8u1eidPlKKV6Ikqq0ODqQ==
+ dependencies:
+ tslib "^2.3.0"
+
"@wry/equality@^0.1.2":
version "0.1.11"
resolved "https://registry.yarnpkg.com/@wry/equality/-/equality-0.1.11.tgz#35cb156e4a96695aa81a9ecc4d03787bc17f1790"
@@ -3166,6 +3197,20 @@
dependencies:
tslib "^1.9.3"
+"@wry/equality@^0.5.0":
+ version "0.5.3"
+ resolved "https://registry.yarnpkg.com/@wry/equality/-/equality-0.5.3.tgz#fafebc69561aa2d40340da89fa7dc4b1f6fb7831"
+ integrity sha512-avR+UXdSrsF2v8vIqIgmeTY0UR91UT+IyablCyKe/uk22uOJ8fusKZnH9JH9e1/EtLeNJBtagNmL3eJdnOV53g==
+ dependencies:
+ tslib "^2.3.0"
+
+"@wry/trie@^0.3.0":
+ version "0.3.2"
+ resolved "https://registry.yarnpkg.com/@wry/trie/-/trie-0.3.2.tgz#a06f235dc184bd26396ba456711f69f8c35097e6"
+ integrity sha512-yRTyhWSls2OY/pYLfwff867r8ekooZ4UI+/gxot5Wj8EFwSf2rG+n+Mo/6LoLQm1TKA4GRj2+LCpbfS937dClQ==
+ dependencies:
+ tslib "^2.3.0"
+
"@xtuc/ieee754@^1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790"
@@ -7453,6 +7498,13 @@ graceful-fs@^4.2.4:
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a"
integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==
+graphql-tag@^2.12.6:
+ version "2.12.6"
+ resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.12.6.tgz#d441a569c1d2537ef10ca3d1633b48725329b5f1"
+ integrity sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg==
+ dependencies:
+ tslib "^2.1.0"
+
graphql-tag@^2.4.2:
version "2.12.5"
resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.12.5.tgz#5cff974a67b417747d05c8d9f5f3cb4495d0db8f"
@@ -7636,6 +7688,13 @@ hmac-drbg@^1.0.1:
minimalistic-assert "^1.0.0"
minimalistic-crypto-utils "^1.0.1"
+hoist-non-react-statics@^3.3.2:
+ version "3.3.2"
+ resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45"
+ integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==
+ dependencies:
+ react-is "^16.7.0"
+
homedir-polyfill@^1.0.1:
version "1.0.3"
resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8"
@@ -9915,7 +9974,7 @@ loglevel@^1.6.8:
resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.7.1.tgz#005fde2f5e6e47068f935ff28573e125ef72f197"
integrity sha512-Hesni4s5UkWkwCGJMQGAh71PaLUmKFM60dHvq0zi/vDhhrzuk+4GgNbTXJ12YYQJn6ZKBDNIjYcuQGKudvqrIw==
-loose-envify@^1.0.0, loose-envify@^1.2.0:
+loose-envify@^1.0.0, loose-envify@^1.2.0, loose-envify@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
@@ -10260,6 +10319,11 @@ mkdirp@^1.0.4:
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"
integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==
+mock-apollo-client@^1.2.1:
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/mock-apollo-client/-/mock-apollo-client-1.2.1.tgz#e3bfdc3ff73b1fea28fa7e91ec82e43ba8cbfa39"
+ integrity sha512-QYQ6Hxo+t7hard1bcHHbsHxlNQYTQsaMNsm2Psh/NbwLMi2R4tGzplJKt97MUWuARHMq3GHB4PTLj/gxej4Caw==
+
moment@^2.19.2:
version "2.29.1"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3"
@@ -10767,6 +10831,14 @@ optimism@^0.10.0:
dependencies:
"@wry/context" "^0.4.0"
+optimism@^0.16.1:
+ version "0.16.2"
+ resolved "https://registry.yarnpkg.com/optimism/-/optimism-0.16.2.tgz#519b0c78b3b30954baed0defe5143de7776bf081"
+ integrity sha512-zWNbgWj+3vLEjZNIh/okkY2EUfX+vB9TJopzIZwT1xxaMqC5hRLLraePod4c5n4He08xuXNH+zhKFFCu390wiQ==
+ dependencies:
+ "@wry/context" "^0.7.0"
+ "@wry/trie" "^0.3.0"
+
optionator@^0.8.1, optionator@^0.8.2:
version "0.8.3"
resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495"
@@ -11721,6 +11793,15 @@ prompts@^2.0.1:
kleur "^3.0.3"
sisteransi "^1.0.5"
+prop-types@^15.7.2:
+ version "15.8.1"
+ resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5"
+ integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==
+ dependencies:
+ loose-envify "^1.4.0"
+ object-assign "^4.1.1"
+ react-is "^16.13.1"
+
proto-list@~1.2.1:
version "1.2.4"
resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849"
@@ -11900,7 +11981,7 @@ raw-body@2.4.0:
iconv-lite "0.4.24"
unpipe "1.0.0"
-react-is@^16.8.4:
+react-is@^16.13.1, react-is@^16.7.0, react-is@^16.8.4:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
@@ -12269,6 +12350,11 @@ resolve@^1.10.0, resolve@^1.10.1, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.1
is-core-module "^2.2.0"
path-parse "^1.0.6"
+response-iterator@^0.2.6:
+ version "0.2.6"
+ resolved "https://registry.yarnpkg.com/response-iterator/-/response-iterator-0.2.6.tgz#249005fb14d2e4eeb478a3f735a28fd8b4c9f3da"
+ integrity sha512-pVzEEzrsg23Sh053rmDUvLSkGXluZio0qu8VT6ukrYuvtjVfCbDZH9d6PGXb8HZfzdNZt8feXv/jvUzlhRgLnw==
+
restore-cursor@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf"
@@ -13406,6 +13492,11 @@ symbol-observable@^1.0.2:
resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804"
integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==
+symbol-observable@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-4.0.0.tgz#5b425f192279e87f2f9b937ac8540d1984b39205"
+ integrity sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==
+
symbol-tree@^3.2.2, symbol-tree@^3.2.4:
version "3.2.4"
resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2"
@@ -13704,6 +13795,13 @@ tryer@^1.0.1:
resolved "https://registry.yarnpkg.com/tryer/-/tryer-1.0.1.tgz#f2c85406800b9b0f74c9f7465b81eaad241252f8"
integrity sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==
+ts-invariant@^0.10.3:
+ version "0.10.3"
+ resolved "https://registry.yarnpkg.com/ts-invariant/-/ts-invariant-0.10.3.tgz#3e048ff96e91459ffca01304dbc7f61c1f642f6c"
+ integrity sha512-uivwYcQaxAucv1CzRp2n/QdYPo4ILf9VXgH19zEIjFx2EJufV16P0JtJVpYHy89DItG6Kwj2oIUjrcK5au+4tQ==
+ dependencies:
+ tslib "^2.1.0"
+
ts-invariant@^0.4.0:
version "0.4.4"
resolved "https://registry.yarnpkg.com/ts-invariant/-/ts-invariant-0.4.4.tgz#97a523518688f93aafad01b0e80eb803eb2abd86"
@@ -13757,6 +13855,11 @@ tslib@^2.1.0:
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.0.tgz#803b8cdab3e12ba581a4ca41c8839bbb0dacb09e"
integrity sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==
+tslib@^2.3.0:
+ version "2.4.1"
+ resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.1.tgz#0d0bfbaac2880b91e22df0768e55be9753a5b17e"
+ integrity sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==
+
tsutils@^3.17.1:
version "3.21.0"
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623"
@@ -14919,7 +15022,14 @@ zen-observable-ts@^0.8.21:
tslib "^1.9.3"
zen-observable "^0.8.0"
-zen-observable@^0.8.0:
+zen-observable-ts@^1.2.5:
+ version "1.2.5"
+ resolved "https://registry.yarnpkg.com/zen-observable-ts/-/zen-observable-ts-1.2.5.tgz#6c6d9ea3d3a842812c6e9519209365a122ba8b58"
+ integrity sha512-QZWQekv6iB72Naeake9hS1KxHlotfRpe+WGNbNx5/ta+R3DNjVO2bswf63gXlWDcs+EMd7XY8HfVQyP1X6T4Zg==
+ dependencies:
+ zen-observable "0.8.15"
+
+zen-observable@0.8.15, zen-observable@^0.8.0:
version "0.8.15"
resolved "https://registry.yarnpkg.com/zen-observable/-/zen-observable-0.8.15.tgz#96415c512d8e3ffd920afd3889604e30b9eaac15"
integrity sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==
diff --git a/package.json b/package.json
index a4bedfdf2..7a01da338 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "gradido",
- "version": "1.16.0",
+ "version": "1.17.1",
"description": "Gradido",
"main": "index.js",
"repository": "git@github.com:gradido/gradido.git",