diff options
Diffstat (limited to 'spec/frontend/repository/utils/dom_spec.js')
-rw-r--r-- | spec/frontend/repository/utils/dom_spec.js | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/spec/frontend/repository/utils/dom_spec.js b/spec/frontend/repository/utils/dom_spec.js index bf98a9e1a4d..0b61161c9d0 100644 --- a/spec/frontend/repository/utils/dom_spec.js +++ b/spec/frontend/repository/utils/dom_spec.js @@ -20,11 +20,18 @@ describe('updateElementsVisibility', () => { }); describe('updateFormAction', () => { - it('updates form action', () => { + it.each` + path + ${'/test'} + ${'test'} + ${'/'} + `('updates form action for $path', ({ path }) => { setHTMLFixture('<form class="js-test" action="/"></form>'); - updateFormAction('.js-test', '/gitlab/create', '/test'); + updateFormAction('.js-test', '/gitlab/create', path); - expect(document.querySelector('.js-test').action).toBe('http://localhost/gitlab/create/test'); + expect(document.querySelector('.js-test').action).toBe( + `http://localhost/gitlab/create/${path.replace(/^\//, '')}`, + ); }); }); |