summaryrefslogtreecommitdiff
path: root/spec/frontend/repository/utils/title_spec.js
blob: 63035933424423f2648b3fcc7a7571ccc60b038c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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 Org / GitLab');

    expect(document.title).toEqual(`${title} · master · GitLab Org / GitLab · GitLab`);
  });
});