diff --git a/components/User.spec.js b/components/User.spec.js index 9a2bb3a4a..0bbf13529 100644 --- a/components/User.spec.js +++ b/components/User.spec.js @@ -79,6 +79,23 @@ describe('User.vue', () => { expect(wrapper.text()).not.toMatch('Tilda Swinton') expect(wrapper.text()).toMatch('Anonymus') }) + + describe('current user is a moderator', () => { + beforeEach(() => { + getters['auth/isModerator'] = () => true + }) + + it('renders user name', () => { + const wrapper = Wrapper() + expect(wrapper.text()).not.toMatch('Anonymous') + expect(wrapper.text()).toMatch('Tilda Swinton') + }) + + it('has "disabled-content" class', () => { + const wrapper = Wrapper() + expect(wrapper.classes()).toContain('disabled-content') + }) + }) }) }) }) diff --git a/components/User.vue b/components/User.vue index 620dee069..bb473d854 100644 --- a/components/User.vue +++ b/components/User.vue @@ -1,5 +1,5 @@