summaryrefslogtreecommitdiff
path: root/spec/frontend/repository/utils/title_spec.js
blob: c4879716fd7291992040c1a5e84549ed283cd596 (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');

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