diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-24 21:09:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-24 21:09:03 +0300 |
commit | c59765a50abd6a235220fd895f5de78038c243a8 (patch) | |
tree | 6cacf61d1746e2d54149c028ecd3f187128cd7da /spec/frontend/helpers | |
parent | 4c5468b40825debc2b7bbe08b975dedd2f7f1523 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/helpers')
-rw-r--r-- | spec/frontend/helpers/vue_mock_directive.js | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/spec/frontend/helpers/vue_mock_directive.js b/spec/frontend/helpers/vue_mock_directive.js index 699fe3eab26..28d4708835d 100644 --- a/spec/frontend/helpers/vue_mock_directive.js +++ b/spec/frontend/helpers/vue_mock_directive.js @@ -2,13 +2,21 @@ export const getKey = name => `$_gl_jest_${name}`; export const getBinding = (el, name) => el[getKey(name)]; +const writeBindingToElement = (el, { name, value, arg, modifiers }) => { + el[getKey(name)] = { + value, + arg, + modifiers, + }; +}; + export const createMockDirective = () => ({ - bind(el, { name, value, arg, modifiers }) { - el[getKey(name)] = { - value, - arg, - modifiers, - }; + bind(el, binding) { + writeBindingToElement(el, binding); + }, + + update(el, binding) { + writeBindingToElement(el, binding); }, unbind(el, { name }) { |