diff --git a/ee/spec/frontend/vulnerabilities/new_vulnerability/section_identifiers_spec.js b/ee/spec/frontend/vulnerabilities/new_vulnerability/section_identifiers_spec.js index 4889dececd59441b5c11f6822708371f1a81f235..e3fb8cdf2eb9cfb2198bf725a7c25848a1d91486 100644 --- a/ee/spec/frontend/vulnerabilities/new_vulnerability/section_identifiers_spec.js +++ b/ee/spec/frontend/vulnerabilities/new_vulnerability/section_identifiers_spec.js @@ -56,20 +56,20 @@ describe('New vulnerability - Section Identifiers', () => { expect(findFormGroup(1).text()).toContain(ERROR_IDENTIFIER_URL); }); - it('emits change event when input changes', () => { + it('emits change event when input changes', async () => { const codeInput = findIdentifierCodeInput(); const urlInput = findIdentifierUrlInput(); codeInput.setValue('cve-23'); urlInput.setValue('https://gitlab.com'); - expect(wrapper.emitted('change')[0][0]).toEqual({ - identifiers: [{ name: 'cve-23', url: '' }], - }); + await nextTick(); - expect(wrapper.emitted('change')[1][0]).toEqual({ - identifiers: [{ name: 'cve-23', url: 'https://gitlab.com' }], - }); + expect(wrapper.emitted('change').at(-1)).toEqual([ + { + identifiers: [{ name: 'cve-23', url: 'https://gitlab.com' }], + }, + ]); }); it('adds and removes identifier rows', async () => {