From 3628fb4272c0b9f5a66f0de61e6c4f37f4908fe7 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 13 Jun 2022 13:19:54 +0300 Subject: fix tests --- test/unit/specs/components/rich_content.spec.js | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'test') diff --git a/test/unit/specs/components/rich_content.spec.js b/test/unit/specs/components/rich_content.spec.js index 958fb997..cd8d4b86 100644 --- a/test/unit/specs/components/rich_content.spec.js +++ b/test/unit/specs/components/rich_content.spec.js @@ -4,7 +4,15 @@ import RichContent from 'src/components/rich_content/rich_content.jsx' const attentions = [] const global = { mocks: { - '$store': null + '$store': { + state: {}, + getters: { + mergedConfig: () => ({ + mentionLinkShowTooltip: true + }), + findUserByUrl: () => null + } + } }, stubs: { FAIcon: true @@ -131,8 +139,7 @@ describe('RichContent', () => { ].join(''), [ makeMention('John'), - makeMention('Josh'), - makeMention('Jeremy') + makeMention('Josh'), makeMention('Jeremy') ].join('') ].join('\n') @@ -359,9 +366,9 @@ describe('RichContent', () => { '', '', '', - '', // v-if placeholder, mentionlink's "new" (i.e. rich) display + '', // vue placeholder '', - '', // v-if placeholder, mentionsline's extra mentions and stuff + '', // vue placeholder, mentionsline's extra mentions and stuff '' ), p( @@ -422,7 +429,7 @@ describe('RichContent', () => { '', '', '', - '', // v-if placeholder, mentionlink's "new" (i.e. rich) display + '', // vue placeholder, mentionlink's "new" (i.e. rich) display '', '', '', @@ -435,9 +442,9 @@ describe('RichContent', () => { '', '', '', - '', // v-if placeholder, mentionlink's "new" (i.e. rich) display + '', // vue placeholder, mentionlink's "new" (i.e. rich) display '', - '', // v-if placeholder, mentionsline's extra mentions and stuff + '', // vue placeholder, mentionsline's extra mentions and stuff '', ' ', '', -- cgit v1.2.3-70-g09d2 From 7d719a2b188ebee78d115e9102e2ad8f3460a2f0 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 21 Jun 2022 01:40:09 +0300 Subject: fix tests by just ignoring the html comments --- test/unit/specs/components/rich_content.spec.js | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'test') diff --git a/test/unit/specs/components/rich_content.spec.js b/test/unit/specs/components/rich_content.spec.js index cd8d4b86..8a18a08b 100644 --- a/test/unit/specs/components/rich_content.spec.js +++ b/test/unit/specs/components/rich_content.spec.js @@ -356,7 +356,6 @@ describe('RichContent', () => { p( '', '', - '', '', '', 'https://', @@ -365,10 +364,7 @@ describe('RichContent', () => { '', '', '', - '', - '', // vue placeholder '', - '', // vue placeholder, mentionsline's extra mentions and stuff '' ), p( @@ -387,7 +383,7 @@ describe('RichContent', () => { } }) - expect(wrapper.html().replace(/\n/g, '')).to.eql(compwrap(expected)) + expect(wrapper.html().replace(/\n/g, '').replace(//g, '')).to.eql(compwrap(expected)) }) it('rich contents of nested mentions are handled properly', () => { @@ -419,7 +415,6 @@ describe('RichContent', () => { '', '', '', - '', '', '', 'https://', @@ -428,11 +423,8 @@ describe('RichContent', () => { '', '', '', - '', - '', // vue placeholder, mentionlink's "new" (i.e. rich) display '', '', - '', '', '', 'https://', @@ -441,10 +433,7 @@ describe('RichContent', () => { '', '', '', - '', - '', // vue placeholder, mentionlink's "new" (i.e. rich) display '', - '', // vue placeholder, mentionsline's extra mentions and stuff '', ' ', '', @@ -462,7 +451,7 @@ describe('RichContent', () => { } }) - expect(wrapper.html().replace(/\n/g, '')).to.eql(compwrap(expected)) + expect(wrapper.html().replace(/\n/g, '').replace(//g, '')).to.eql(compwrap(expected)) }) it('rich contents of a link are handled properly', () => { -- cgit v1.2.3-70-g09d2