123456789101112131415161718192021222324252627282930313233343536373839404142 |
- import {render, screen} from 'sentry-test/reactTestingLibrary';
- import GroupReleaseStats from 'sentry/components/group/releaseStats';
- describe('GroupReleaseStats', function () {
- const organization = TestStubs.Organization();
- const project = TestStubs.Project();
- const createWrapper = props =>
- render(
- <GroupReleaseStats
- group={TestStubs.Group()}
- project={project}
- organization={organization}
- allEnvironments={TestStubs.Group()}
- environments={[]}
- {...props}
- />
- );
- it('renders all environments', function () {
- createWrapper();
- expect(screen.getByText('Last 24 Hours')).toBeInTheDocument();
- expect(screen.getByText('Last 30 Days')).toBeInTheDocument();
- expect(screen.getByText('Last seen')).toBeInTheDocument();
- expect(screen.getByText('First seen')).toBeInTheDocument();
- // Displays counts
- expect(screen.getByText('3')).toBeInTheDocument();
- expect(screen.getByText('123')).toBeInTheDocument();
- });
- it('renders specific environments', function () {
- createWrapper({environments: TestStubs.Environments()});
- expect(screen.getByText('Last 24 Hours')).toBeInTheDocument();
- expect(screen.getByText('Last 30 Days')).toBeInTheDocument();
- expect(screen.getByText('Last seen')).toBeInTheDocument();
- expect(screen.getByText('First seen')).toBeInTheDocument();
- // Displays counts
- expect(screen.getByText('3')).toBeInTheDocument();
- expect(screen.getByText('123')).toBeInTheDocument();
- });
- });
|