Skip to content
Snippets Groups Projects
Verified Commit d2ed4e7d authored by Lorenz van Herwaarden's avatar Lorenz van Herwaarden :two: 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', () => {
createWrapper({ stubs: { MarkdownEditor: stubComponent(MarkdownEditor) } });
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({
vulnerabilityName: fieldValue,
vulnerabilityDesc: '',
});
expect(wrapper.emitted('change').at(-1)).toEqual([
{
vulnerabilityName: fieldValue,
vulnerabilityDesc: '',
},
]);
});
it('emits the changes: Description', () => {
......@@ -72,10 +74,12 @@ describe('New vulnerability - Section Name', () => {
wrapper.findComponent(MarkdownField).find('textarea').setValue(fieldValue);
wrapper.findComponent(MarkdownEditor).vm.$emit('input', fieldValue);
expect(wrapper.emitted('change')[1][0]).toEqual({
vulnerabilityName: '',
vulnerabilityDesc: fieldValue,
});
expect(wrapper.emitted('change').at(-1)).toEqual([
{
vulnerabilityName: '',
vulnerabilityDesc: fieldValue,
},
]);
});
it('does not display invalid state by default', () => {
......
......@@ -39,7 +39,7 @@ describe('New vulnerability - Section Solution', () => {
wrapper.findComponent(MarkdownField).find('textarea').setValue(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', () => {
......
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