diff options
author | Phil Hughes <me@iamphill.com> | 2019-05-24 17:48:29 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-05-24 18:00:14 +0300 |
commit | ecf54c2316e7c62d6afe35885e79d97e6e6c13c7 (patch) | |
tree | 9addc75576373b3a7cb146d10dacd03cfe497eab /spec | |
parent | c0ea4164cdc21e831fbbfa9dee48a6fa2766d9fc (diff) |
Update document title when repository router changes
Diffstat (limited to 'spec')
-rw-r--r-- | spec/frontend/repository/utils/title_spec.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/frontend/repository/utils/title_spec.js b/spec/frontend/repository/utils/title_spec.js new file mode 100644 index 00000000000..c4879716fd7 --- /dev/null +++ b/spec/frontend/repository/utils/title_spec.js @@ -0,0 +1,15 @@ +import { setTitle } from '~/repository/utils/title'; + +describe('setTitle', () => { + it.each` + path | title + ${'/'} | ${'Files'} + ${'app'} | ${'app'} + ${'app/assets'} | ${'app/assets'} + ${'app/assets/javascripts'} | ${'app/assets/javascripts'} + `('sets document title as $title for $path', ({ path, title }) => { + setTitle(path, 'master', 'GitLab'); + + expect(document.title).toEqual(`${title} · master · GitLab`); + }); +}); |