Skip to content
Snippets Groups Projects
Verified Commit d2ed4e7d authored by Lorenz van Herwaarden's avatar Lorenz van Herwaarden 2️⃣ Committed by GitLab
Browse files

Fix vue 3 jest spec failure for section_name and section_solution

parent e886496b
No related branches found
No related tags found
2 merge requests!164749Enable parallel in test-on-omnibus,!163549Fix vue 3 jest spec failure for section_name and section_solution
...@@ -57,12 +57,14 @@ describe('New vulnerability - Section Name', () => { ...@@ -57,12 +57,14 @@ describe('New vulnerability - Section Name', () => {
createWrapper({ stubs: { MarkdownEditor: stubComponent(MarkdownEditor) } }); createWrapper({ stubs: { MarkdownEditor: stubComponent(MarkdownEditor) } });
wrapper.findComponent(GlFormInput).setValue(fieldValue); wrapper.findComponent(GlFormInput).setValue(fieldValue);
wrapper.findComponent(GlFormInput).vm.$emit('change', fieldValue); wrapper.findComponent(GlFormInput).vm.$emit('input', fieldValue);
expect(wrapper.emitted('change')[0][0]).toEqual({ expect(wrapper.emitted('change').at(-1)).toEqual([
vulnerabilityName: fieldValue, {
vulnerabilityDesc: '', vulnerabilityName: fieldValue,
}); vulnerabilityDesc: '',
},
]);
}); });
it('emits the changes: Description', () => { it('emits the changes: Description', () => {
...@@ -72,10 +74,12 @@ describe('New vulnerability - Section Name', () => { ...@@ -72,10 +74,12 @@ describe('New vulnerability - Section Name', () => {
wrapper.findComponent(MarkdownField).find('textarea').setValue(fieldValue); wrapper.findComponent(MarkdownField).find('textarea').setValue(fieldValue);
wrapper.findComponent(MarkdownEditor).vm.$emit('input', fieldValue); wrapper.findComponent(MarkdownEditor).vm.$emit('input', fieldValue);
expect(wrapper.emitted('change')[1][0]).toEqual({ expect(wrapper.emitted('change').at(-1)).toEqual([
vulnerabilityName: '', {
vulnerabilityDesc: fieldValue, vulnerabilityName: '',
}); vulnerabilityDesc: fieldValue,
},
]);
}); });
it('does not display invalid state by default', () => { it('does not display invalid state by default', () => {
......
...@@ -39,7 +39,7 @@ describe('New vulnerability - Section Solution', () => { ...@@ -39,7 +39,7 @@ describe('New vulnerability - Section Solution', () => {
wrapper.findComponent(MarkdownField).find('textarea').setValue(solution); wrapper.findComponent(MarkdownField).find('textarea').setValue(solution);
wrapper.findComponent(MarkdownEditor).vm.$emit('input', solution); wrapper.findComponent(MarkdownEditor).vm.$emit('input', solution);
expect(wrapper.emitted('change')[1][0]).toEqual({ solution }); expect(wrapper.emitted('change').at(-1)).toEqual([{ solution }]);
}); });
it('allows switching to rich text editor', () => { it('allows switching to rich text editor', () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment