github.com/thanos-io/thanos@v0.32.5/pkg/ui/react-app/src/pages/status/Status.test.tsx (about)

     1  import * as React from 'react';
     2  import { shallow } from 'enzyme';
     3  import toJson from 'enzyme-to-json';
     4  import { StatusContent } from './Status';
     5  
     6  describe('Status', () => {
     7    describe('Snapshot testing', () => {
     8      const response: any = [
     9        {
    10          startTime: '2019-10-30T22:03:23.247913868+02:00',
    11          CWD: '/home/boyskila/Desktop/prometheus',
    12          reloadConfigSuccess: true,
    13          lastConfigTime: '2019-10-30T22:03:23+02:00',
    14          chunkCount: 1383,
    15          timeSeriesCount: 461,
    16          corruptionCount: 0,
    17          goroutineCount: 37,
    18          GOMAXPROCS: 4,
    19          GOGC: '',
    20          GODEBUG: '',
    21          storageRetention: '15d',
    22        },
    23        {
    24          version: '',
    25          revision: '',
    26          branch: '',
    27          buildUser: '',
    28          buildDate: '',
    29          goVersion: 'go1.13.3',
    30        },
    31        {
    32          activeAlertmanagers: [
    33            { url: 'https://1.2.3.4:9093/api/v1/alerts' },
    34            { url: 'https://1.2.3.5:9093/api/v1/alerts' },
    35            { url: 'https://1.2.3.6:9093/api/v1/alerts' },
    36            { url: 'https://1.2.3.7:9093/api/v1/alerts' },
    37            { url: 'https://1.2.3.8:9093/api/v1/alerts' },
    38            { url: 'https://1.2.3.9:9093/api/v1/alerts' },
    39          ],
    40          droppedAlertmanagers: [],
    41        },
    42      ];
    43      it('should match table snapshot', () => {
    44        const wrapper = shallow(<StatusContent data={response} title="Foo" />);
    45        expect(toJson(wrapper)).toMatchSnapshot();
    46        jest.restoreAllMocks();
    47      });
    48    });
    49  });