diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-08 00:09:45 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-08 00:09:45 +0000 |
commit | b4ddc240452f468b7db1662c6cc36d15b9995030 (patch) | |
tree | d32c0049c344030f802fc230c0ac4da696a83f66 /spec/frontend/issuable | |
parent | 3a966afb3ea2ef7a98bdc389e0dc906ef4bf0273 (diff) | |
download | gitlab-ce-b4ddc240452f468b7db1662c6cc36d15b9995030.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/issuable')
-rw-r--r-- | spec/frontend/issuable/related_issues/components/related_issues_root_spec.js | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/spec/frontend/issuable/related_issues/components/related_issues_root_spec.js b/spec/frontend/issuable/related_issues/components/related_issues_root_spec.js index 2544d0bd030..2c02e1e1de4 100644 --- a/spec/frontend/issuable/related_issues/components/related_issues_root_spec.js +++ b/spec/frontend/issuable/related_issues/components/related_issues_root_spec.js @@ -280,7 +280,7 @@ describe('RelatedIssuesRoot', () => { const input = 'asdf/qwer#444 #12 '; wrapper.vm.onInput({ untouchedRawReferences: input.trim().split(/\s/), - touchedReference: 2, + touchedReference: '2', }); expect(wrapper.vm.state.pendingReferences).toHaveLength(2); @@ -292,13 +292,37 @@ describe('RelatedIssuesRoot', () => { const input = 'something random '; wrapper.vm.onInput({ untouchedRawReferences: input.trim().split(/\s/), - touchedReference: 2, + touchedReference: '2', }); expect(wrapper.vm.state.pendingReferences).toHaveLength(2); expect(wrapper.vm.state.pendingReferences[0]).toEqual('something'); expect(wrapper.vm.state.pendingReferences[1]).toEqual('random'); }); + + it('prepends # when user enters a numeric value [0-9]', async () => { + const input = '23'; + + wrapper.vm.onInput({ + untouchedRawReferences: input.trim().split(/\s/), + touchedReference: input, + }); + + expect(wrapper.vm.inputValue).toBe(`#${input}`); + }); + + it('prepends # when user enters a number', async () => { + const input = 23; + + wrapper.vm.onInput({ + untouchedRawReferences: String(input) + .trim() + .split(/\s/), + touchedReference: input, + }); + + expect(wrapper.vm.inputValue).toBe(`#${input}`); + }); }); describe('onBlur', () => { |