123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- import {initializeOrg} from 'sentry-test/initializeOrg';
- import {render, screen} from 'sentry-test/reactTestingLibrary';
- import IntegrationRow from 'sentry/views/settings/organizationIntegrations/integrationRow';
- describe('IntegrationRow', function () {
- const {organization: org, router} = initializeOrg();
- describe('SentryApp', function () {
- it('is an internal SentryApp', function () {
- render(
- <IntegrationRow
- organization={org}
- type="sentryApp"
- slug="my-headband-washer-289499"
- displayName="My Headband Washer"
- status="Installed"
- publishStatus="internal"
- configurations={0}
- categories={[]}
- />
- );
- expect(screen.getByText('My Headband Washer')).toBeInTheDocument();
- expect(screen.getByText('Installed')).toBeInTheDocument();
- expect(screen.getByText('internal')).toBeInTheDocument();
- });
- it('is a published SentryApp', function () {
- render(
- <IntegrationRow
- organization={org}
- type="sentryApp"
- slug="clickup"
- displayName="ClickUp"
- status="Not Installed"
- publishStatus="published"
- configurations={0}
- categories={[]}
- />,
- {router}
- );
- expect(screen.getByText('ClickUp')).toBeInTheDocument();
- expect(screen.getByText('ClickUp')).toHaveAttribute(
- 'href',
- `/settings/${org.slug}/sentry-apps/clickup/`
- );
- expect(screen.getByText('Not Installed')).toBeInTheDocument();
- });
- });
- describe('First Party Integration', function () {
- it('has been installed (1 configuration)', function () {
- render(
- <IntegrationRow
- organization={org}
- type="firstParty"
- slug="bitbucket"
- displayName="Bitbucket"
- status="Installed"
- publishStatus="published"
- configurations={1}
- categories={[]}
- />,
- {router}
- );
- expect(screen.getByText('Bitbucket')).toBeInTheDocument();
- expect(screen.getByText('Bitbucket')).toHaveAttribute(
- 'href',
- `/settings/${org.slug}/integrations/bitbucket/`
- );
- expect(screen.getByText('1 Configuration')).toBeInTheDocument();
- });
- it('has been installed (3 configurations)', function () {
- render(
- <IntegrationRow
- organization={org}
- type="firstParty"
- slug="bitbucket"
- displayName="Bitbucket"
- status="Installed"
- publishStatus="published"
- configurations={3}
- categories={[]}
- />,
- {router}
- );
- expect(screen.getByText('Installed')).toBeInTheDocument();
- expect(screen.getByText('Bitbucket')).toHaveAttribute(
- 'href',
- `/settings/${org.slug}/integrations/bitbucket/`
- );
- expect(screen.getByText('3 Configurations')).toBeInTheDocument();
- });
- it('has not been installed', function () {
- render(
- <IntegrationRow
- organization={org}
- type="firstParty"
- slug="github"
- displayName="Github"
- status="Not Installed"
- publishStatus="published"
- configurations={0}
- categories={[]}
- />,
- {router}
- );
- expect(screen.getByText('Not Installed')).toBeInTheDocument();
- expect(screen.getByText('Github')).toHaveAttribute(
- 'href',
- `/settings/${org.slug}/integrations/github/`
- );
- });
- });
- describe('Plugin', function () {
- it('has been installed (1 project)', function () {
- render(
- <IntegrationRow
- organization={org}
- type="plugin"
- slug="twilio"
- displayName="Twilio (SMS) "
- status="Installed"
- publishStatus="published"
- configurations={1}
- categories={[]}
- />,
- {router}
- );
- expect(screen.getByText('Installed')).toBeInTheDocument();
- expect(screen.getByText('1 Configuration')).toBeInTheDocument();
- expect(screen.getByText('Twilio (SMS)')).toHaveAttribute(
- 'href',
- `/settings/${org.slug}/plugins/twilio/`
- );
- });
- it('has been installed (3 projects)', function () {
- render(
- <IntegrationRow
- organization={org}
- type="plugin"
- slug="twilio"
- displayName="Twilio (SMS) "
- status="Installed"
- publishStatus="published"
- configurations={3}
- categories={[]}
- />,
- {router}
- );
- expect(screen.getByText('Installed')).toBeInTheDocument();
- expect(screen.getByText('3 Configurations')).toBeInTheDocument();
- expect(screen.getByText('Twilio (SMS)')).toHaveAttribute(
- 'href',
- `/settings/${org.slug}/plugins/twilio/`
- );
- });
- it('has not been installed', function () {
- render(
- <IntegrationRow
- organization={org}
- type="plugin"
- slug="amazon-sqs"
- displayName="Amazon SQS"
- status="Not Installed"
- publishStatus="published"
- configurations={0}
- categories={[]}
- />
- );
- expect(screen.getByText('Not Installed')).toBeInTheDocument();
- expect(screen.getByText('Amazon SQS')).toBeInTheDocument();
- });
- });
- });
|