From 4ca18522f118a70607e6a8062846990fadf1cdc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Mon, 20 Jan 2020 18:00:12 +0100 Subject: [PATCH] Implement the filed report notification on the notification page - Get all the old tests running. - Implement new necessary tests. - Lint fixing. --- cypress/integration/common/steps.js | 2 +- .../Notification/Notification.spec.js | 22 +-- .../components/Notification/Notification.vue | 135 ++++-------------- .../NotificationList/NotificationList.spec.js | 4 +- .../NotificationsTable.spec.js | 83 ++++++++--- .../NotificationsTable/NotificationsTable.vue | 89 +++++++++--- webapp/components/utils/Notifications.js | 113 +++++++++++++++ webapp/graphql/User.js | 2 + webapp/locales/de.json | 11 +- webapp/locales/en.json | 13 +- 10 files changed, 305 insertions(+), 169 deletions(-) diff --git a/cypress/integration/common/steps.js b/cypress/integration/common/steps.js index 8e08be2cf..8e2d9a5ad 100644 --- a/cypress/integration/common/steps.js +++ b/cypress/integration/common/steps.js @@ -362,7 +362,7 @@ When("I log in with the following credentials:", table => { When("open the notification menu and click on the first item", () => { cy.get(".notifications-menu").invoke('show').click(); // "invoke('show')" because of the delay for show the menu - cy.get(".notification-mention-post") + cy.get(".notification-link-for-test") .first() .click({ force: true diff --git a/webapp/components/Notification/Notification.spec.js b/webapp/components/Notification/Notification.spec.js index 060154a70..0569fb3e3 100644 --- a/webapp/components/Notification/Notification.spec.js +++ b/webapp/components/Notification/Notification.spec.js @@ -235,21 +235,21 @@ describe('Notification', () => { expect(wrapper.text()).toContain('Mrs. Badwomen') }) - it('renders the identifier "notifications.filedReport.category"', () => { - wrapper = Wrapper() - expect(wrapper.text()).toContain('notifications.filedReport.category') - }) - - it('renders the identifier "notifications.filedReport.description"', () => { - wrapper = Wrapper() - expect(wrapper.text()).toContain('notifications.filedReport.description') - }) - - it('renders the users slug', () => { + it('renders the reported users slug', () => { wrapper = Wrapper() expect(wrapper.text()).toContain('@mrs.-badwomen') }) + it('renders the identifier "notifications.report.category"', () => { + wrapper = Wrapper() + expect(wrapper.text()).toContain('notifications.report.category') + }) + + it('renders the identifier "notifications.report.description"', () => { + wrapper = Wrapper() + expect(wrapper.text()).toContain('notifications.report.description') + }) + it('has no class "read"', () => { wrapper = Wrapper() expect(wrapper.classes()).not.toContain('read') diff --git a/webapp/components/Notification/Notification.vue b/webapp/components/Notification/Notification.vue index 6c9a2c6a2..7f0da9a0d 100644 --- a/webapp/components/Notification/Notification.vue +++ b/webapp/components/Notification/Notification.vue @@ -1,43 +1,52 @@