diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-12 21:06:57 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-12 21:06:57 +0300 |
commit | 6d31b8f052d30b7e55128d17b66bceed8c6065a9 (patch) | |
tree | ca428cf6145af7cfaada94378e66bd5e7cc5a429 /spec/frontend/repository/utils | |
parent | 69944ffb68788d190e81ff7e33db5dcb6c903184 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/repository/utils')
-rw-r--r-- | spec/frontend/repository/utils/dom_spec.js | 20 | ||||
-rw-r--r-- | spec/frontend/repository/utils/title_spec.js | 4 |
2 files changed, 22 insertions, 2 deletions
diff --git a/spec/frontend/repository/utils/dom_spec.js b/spec/frontend/repository/utils/dom_spec.js new file mode 100644 index 00000000000..678d444904d --- /dev/null +++ b/spec/frontend/repository/utils/dom_spec.js @@ -0,0 +1,20 @@ +import { setHTMLFixture } from '../../helpers/fixtures'; +import { updateElementsVisibility } from '~/repository/utils/dom'; + +describe('updateElementsVisibility', () => { + it('adds hidden class', () => { + setHTMLFixture('<div class="js-test"></div>'); + + updateElementsVisibility('.js-test', false); + + expect(document.querySelector('.js-test').classList).toContain('hidden'); + }); + + it('removes hidden class', () => { + setHTMLFixture('<div class="hidden js-test"></div>'); + + updateElementsVisibility('.js-test', true); + + expect(document.querySelector('.js-test').classList).not.toContain('hidden'); + }); +}); diff --git a/spec/frontend/repository/utils/title_spec.js b/spec/frontend/repository/utils/title_spec.js index c4879716fd7..63035933424 100644 --- a/spec/frontend/repository/utils/title_spec.js +++ b/spec/frontend/repository/utils/title_spec.js @@ -8,8 +8,8 @@ describe('setTitle', () => { ${'app/assets'} | ${'app/assets'} ${'app/assets/javascripts'} | ${'app/assets/javascripts'} `('sets document title as $title for $path', ({ path, title }) => { - setTitle(path, 'master', 'GitLab'); + setTitle(path, 'master', 'GitLab Org / GitLab'); - expect(document.title).toEqual(`${title} · master · GitLab`); + expect(document.title).toEqual(`${title} · master · GitLab Org / GitLab · GitLab`); }); }); |