Welcome to mirror list, hosted at ThFree Co, Russian Federation.

hello_spec.js « logger « lib « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 39c1b55313b78f709ffe96566185c43cafe36c18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { logHello } from '~/lib/logger/hello';

describe('~/lib/logger/hello', () => {
  let consoleLogSpy;

  beforeEach(() => {
    // We don't `mockImplementation` so we can validate there's no errors thrown
    consoleLogSpy = jest.spyOn(console, 'log');
  });

  describe('logHello', () => {
    describe('when on dot_com', () => {
      beforeEach(() => {
        gon.dot_com = true;
      });

      it('console logs a friendly hello message including the careers page', () => {
        expect(consoleLogSpy).not.toHaveBeenCalled();

        logHello();

        expect(consoleLogSpy.mock.calls).toMatchSnapshot();
      });
    });

    describe('when on self managed', () => {
      beforeEach(() => {
        gon.dot_com = false;
      });

      it('console logs a friendly hello message without including the careers page', () => {
        expect(consoleLogSpy).not.toHaveBeenCalled();

        logHello();

        expect(consoleLogSpy.mock.calls).toMatchSnapshot();
      });
    });
  });
});