diff --git a/components/Comment.spec.js b/components/Comment.spec.js index e9efe262f..c0cb8ebfc 100644 --- a/components/Comment.spec.js +++ b/components/Comment.spec.js @@ -39,6 +39,24 @@ describe('Comment.vue', () => { const wrapper = Wrapper() expect(wrapper.text()).toMatch('Hello I am a comment content') }) + + describe('which is disabled', () => { + beforeEach(() => { + propsData.comment.disabled = true + }) + + it('renders no comment data', () => { + const wrapper = Wrapper() + expect(wrapper.text()).not.toMatch('comment content') + }) + + it('translates a placeholder', () => { + const wrapper = Wrapper() + const calls = mocks.$t.mock.calls + const expected = [['comment.content.disabled-placeholder']] + expect(calls).toEqual(expect.arrayContaining(expected)) + }) + }) }) }) }) diff --git a/components/Comment.vue b/components/Comment.vue index 097ba957d..f24bad7d4 100644 --- a/components/Comment.vue +++ b/components/Comment.vue @@ -1,6 +1,11 @@ @@ -13,6 +18,11 @@ export default { return {} } } + }, + computed: { + disabled() { + return this.comment.disabled + } } }