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

     1  import React from 'react';
     2  import { shallow } from 'enzyme';
     3  import Targets from './Targets';
     4  import ScrapePoolList from './ScrapePoolList';
     5  
     6  describe('Targets', () => {
     7    const defaultProps = {
     8      pathPrefix: '..',
     9    };
    10    const targets = shallow(<Targets {...defaultProps} />);
    11    describe('Header', () => {
    12      const h2 = targets.find('h2');
    13      it('renders a header', () => {
    14        expect(h2.text()).toEqual('Targets');
    15      });
    16      it('renders exactly one header', () => {
    17        const h2 = targets.find('h2');
    18        expect(h2).toHaveLength(1);
    19      });
    20    });
    21    it('renders a scrape pool list', () => {
    22      const scrapePoolList = targets.find(ScrapePoolList);
    23      expect(scrapePoolList).toHaveLength(1);
    24    });
    25  });