debian-mirror-gitlab/spec/frontend/repository/utils/title_spec.js

16 lines
559 B
JavaScript
Raw Normal View History

2019-09-04 21:01:54 +05:30
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 }) => {
2019-12-26 22:10:19 +05:30
setTitle(path, 'master', 'GitLab Org / GitLab');
2019-09-04 21:01:54 +05:30
2019-12-26 22:10:19 +05:30
expect(document.title).toEqual(`${title} · master · GitLab Org / GitLab · GitLab`);
2019-09-04 21:01:54 +05:30
});
});