From 6671d893e6094a240368e83be0a7b2a1a875ee86 Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Tue, 11 Feb 2020 09:20:45 +0100 Subject: [PATCH] refactor PostCard (wip) --- webapp/components/ContentMenu/ContentMenu.vue | 2 +- .../Notification/Notification.spec.js | 30 +-- .../components/Notification/Notification.vue | 6 +- .../NotificationList/NotificationList.spec.js | 2 +- webapp/components/PostCard/PostCard.vue | 225 +++++++++--------- 5 files changed, 131 insertions(+), 134 deletions(-) diff --git a/webapp/components/ContentMenu/ContentMenu.vue b/webapp/components/ContentMenu/ContentMenu.vue index ba273e28a..67f28817e 100644 --- a/webapp/components/ContentMenu/ContentMenu.vue +++ b/webapp/components/ContentMenu/ContentMenu.vue @@ -8,7 +8,7 @@ size="small" circle ghost - @click="toggleMenu" + @click.prevent="toggleMenu()" /> diff --git a/webapp/components/Notification/Notification.spec.js b/webapp/components/Notification/Notification.spec.js index 750f59b3a..537babfae 100644 --- a/webapp/components/Notification/Notification.spec.js +++ b/webapp/components/Notification/Notification.spec.js @@ -63,7 +63,7 @@ describe('Notification', () => { it('renders reason', () => { wrapper = Wrapper() - expect(wrapper.find('.reason-text-for-test').text()).toEqual( + expect(wrapper.find('.notification > .description').text()).toEqual( 'notifications.reason.commented_on_post', ) }) @@ -79,9 +79,9 @@ describe('Notification', () => { wrapper = Wrapper() expect(wrapper.text()).toContain('@dagobert-duck is the best on this comment.') }) - it('has no class "read"', () => { + it('has no class "--read"', () => { wrapper = Wrapper() - expect(wrapper.classes()).not.toContain('read') + expect(wrapper.classes()).not.toContain('--read') }) describe('that is read', () => { @@ -90,8 +90,8 @@ describe('Notification', () => { wrapper = Wrapper() }) - it('has class "read"', () => { - expect(wrapper.classes()).toContain('read') + it('has class "--read"', () => { + expect(wrapper.classes()).toContain('--read') }) }) }) @@ -113,7 +113,7 @@ describe('Notification', () => { it('renders reason', () => { wrapper = Wrapper() - expect(wrapper.find('.reason-text-for-test').text()).toEqual( + expect(wrapper.find('.notification > .description').text()).toEqual( 'notifications.reason.mentioned_in_post', ) }) @@ -125,9 +125,9 @@ describe('Notification', () => { wrapper = Wrapper() expect(wrapper.text()).toContain('@jenny-rostock is the best on this post.') }) - it('has no class "read"', () => { + it('has no class "--read"', () => { wrapper = Wrapper() - expect(wrapper.classes()).not.toContain('read') + expect(wrapper.classes()).not.toContain('--read') }) describe('that is read', () => { @@ -136,8 +136,8 @@ describe('Notification', () => { wrapper = Wrapper() }) - it('has class "read"', () => { - expect(wrapper.classes()).toContain('read') + it('has class "--read"', () => { + expect(wrapper.classes()).toContain('--read') }) }) }) @@ -163,7 +163,7 @@ describe('Notification', () => { it('renders reason', () => { wrapper = Wrapper() - expect(wrapper.find('.reason-text-for-test').text()).toEqual( + expect(wrapper.find('.notification > .description').text()).toEqual( 'notifications.reason.mentioned_in_comment', ) }) @@ -182,9 +182,9 @@ describe('Notification', () => { expect(wrapper.text()).toContain('@dagobert-duck is the best on this comment.') }) - it('has no class "read"', () => { + it('has no class "--read"', () => { wrapper = Wrapper() - expect(wrapper.classes()).not.toContain('read') + expect(wrapper.classes()).not.toContain('--read') }) describe('that is read', () => { @@ -193,8 +193,8 @@ describe('Notification', () => { wrapper = Wrapper() }) - it('has class "read"', () => { - expect(wrapper.classes()).toContain('read') + it('has class "--read"', () => { + expect(wrapper.classes()).toContain('--read') }) }) }) diff --git a/webapp/components/Notification/Notification.vue b/webapp/components/Notification/Notification.vue index 34c57b368..deb012c10 100644 --- a/webapp/components/Notification/Notification.vue +++ b/webapp/components/Notification/Notification.vue @@ -1,5 +1,5 @@