|
@@ -1,3 +1,4 @@
|
|
|
+import {initializeOrg} from 'sentry-test/initializeOrg';
|
|
|
import {
|
|
|
render,
|
|
|
renderGlobalModal,
|
|
@@ -10,7 +11,7 @@ import {
|
|
|
import OrganizationDeveloperSettings from 'sentry/views/settings/organizationDeveloperSettings/index';
|
|
|
|
|
|
describe('Organization Developer Settings', function () {
|
|
|
- const org = TestStubs.Organization();
|
|
|
+ const {organization: org, routerProps, router} = initializeOrg();
|
|
|
const sentryApp = TestStubs.SentryApp({
|
|
|
scopes: [
|
|
|
'team:read',
|
|
@@ -26,8 +27,6 @@ describe('Organization Developer Settings', function () {
|
|
|
MockApiClient.clearMockResponses();
|
|
|
});
|
|
|
|
|
|
- const router = TestStubs.router();
|
|
|
-
|
|
|
describe('when no Apps exist', () => {
|
|
|
it('displays empty state', async () => {
|
|
|
MockApiClient.addMockResponse({
|
|
@@ -35,15 +34,7 @@ describe('Organization Developer Settings', function () {
|
|
|
body: [],
|
|
|
});
|
|
|
const {container} = render(
|
|
|
- <OrganizationDeveloperSettings
|
|
|
- organization={org}
|
|
|
- router={router}
|
|
|
- route={router.routes[0]}
|
|
|
- params={router.params}
|
|
|
- routeParams={router.params}
|
|
|
- location={router.location}
|
|
|
- routes={router.routes}
|
|
|
- />
|
|
|
+ <OrganizationDeveloperSettings {...routerProps} organization={org} />
|
|
|
);
|
|
|
await waitFor(() => {
|
|
|
expect(
|
|
@@ -63,18 +54,9 @@ describe('Organization Developer Settings', function () {
|
|
|
});
|
|
|
|
|
|
it('internal integrations list is empty', () => {
|
|
|
- render(
|
|
|
- <OrganizationDeveloperSettings
|
|
|
- organization={org}
|
|
|
- router={router}
|
|
|
- route={router.routes[0]}
|
|
|
- params={router.params}
|
|
|
- routeParams={router.params}
|
|
|
- location={router.location}
|
|
|
- routes={router.routes}
|
|
|
- />,
|
|
|
- {organization: org}
|
|
|
- );
|
|
|
+ render(<OrganizationDeveloperSettings {...routerProps} organization={org} />, {
|
|
|
+ organization: org,
|
|
|
+ });
|
|
|
expect(
|
|
|
screen.getByText('No internal integrations have been created yet.')
|
|
|
).toBeInTheDocument();
|
|
@@ -83,12 +65,8 @@ describe('Organization Developer Settings', function () {
|
|
|
it('public integrations list contains 1 item', () => {
|
|
|
render(
|
|
|
<OrganizationDeveloperSettings
|
|
|
+ {...routerProps}
|
|
|
organization={org}
|
|
|
- router={router}
|
|
|
- route={router.routes[0]}
|
|
|
- params={router.params}
|
|
|
- routeParams={router.params}
|
|
|
- routes={router.routes}
|
|
|
location={{...router.location, query: {type: 'public'}}}
|
|
|
/>,
|
|
|
{organization: org}
|
|
@@ -105,12 +83,8 @@ describe('Organization Developer Settings', function () {
|
|
|
});
|
|
|
render(
|
|
|
<OrganizationDeveloperSettings
|
|
|
+ {...routerProps}
|
|
|
organization={org}
|
|
|
- router={router}
|
|
|
- route={router.routes[0]}
|
|
|
- params={router.params}
|
|
|
- routeParams={router.params}
|
|
|
- routes={router.routes}
|
|
|
location={{...router.location, query: {type: 'public'}}}
|
|
|
/>
|
|
|
);
|
|
@@ -140,12 +114,8 @@ describe('Organization Developer Settings', function () {
|
|
|
|
|
|
render(
|
|
|
<OrganizationDeveloperSettings
|
|
|
+ {...routerProps}
|
|
|
organization={org}
|
|
|
- router={router}
|
|
|
- route={router.routes[0]}
|
|
|
- params={router.params}
|
|
|
- routeParams={router.params}
|
|
|
- routes={router.routes}
|
|
|
location={{...router.location, query: {type: 'public'}}}
|
|
|
/>
|
|
|
);
|
|
@@ -207,12 +177,8 @@ describe('Organization Developer Settings', function () {
|
|
|
it('shows the published status', () => {
|
|
|
render(
|
|
|
<OrganizationDeveloperSettings
|
|
|
+ {...routerProps}
|
|
|
organization={org}
|
|
|
- router={router}
|
|
|
- route={router.routes[0]}
|
|
|
- params={router.params}
|
|
|
- routeParams={router.params}
|
|
|
- routes={router.routes}
|
|
|
location={{...router.location, query: {type: 'public'}}}
|
|
|
/>
|
|
|
);
|
|
@@ -222,12 +188,8 @@ describe('Organization Developer Settings', function () {
|
|
|
it('trash button is disabled', async () => {
|
|
|
render(
|
|
|
<OrganizationDeveloperSettings
|
|
|
+ {...routerProps}
|
|
|
organization={org}
|
|
|
- router={router}
|
|
|
- route={router.routes[0]}
|
|
|
- params={router.params}
|
|
|
- routeParams={router.params}
|
|
|
- routes={router.routes}
|
|
|
location={{...router.location, query: {type: 'public'}}}
|
|
|
/>
|
|
|
);
|
|
@@ -238,12 +200,8 @@ describe('Organization Developer Settings', function () {
|
|
|
it('publish button is disabled', async () => {
|
|
|
render(
|
|
|
<OrganizationDeveloperSettings
|
|
|
+ {...routerProps}
|
|
|
organization={org}
|
|
|
- router={router}
|
|
|
- route={router.routes[0]}
|
|
|
- params={router.params}
|
|
|
- routeParams={router.params}
|
|
|
- routes={router.routes}
|
|
|
location={{...router.location, query: {type: 'public'}}}
|
|
|
/>
|
|
|
);
|
|
@@ -263,33 +221,13 @@ describe('Organization Developer Settings', function () {
|
|
|
});
|
|
|
|
|
|
it('allows deleting', async () => {
|
|
|
- render(
|
|
|
- <OrganizationDeveloperSettings
|
|
|
- organization={org}
|
|
|
- router={router}
|
|
|
- route={router.routes[0]}
|
|
|
- params={router.params}
|
|
|
- routeParams={router.params}
|
|
|
- location={router.location}
|
|
|
- routes={router.routes}
|
|
|
- />
|
|
|
- );
|
|
|
+ render(<OrganizationDeveloperSettings {...routerProps} organization={org} />);
|
|
|
const deleteButton = await screen.findByRole('button', {name: 'Delete'});
|
|
|
expect(deleteButton).toHaveAttribute('aria-disabled', 'false');
|
|
|
});
|
|
|
|
|
|
it('publish button does not exist', () => {
|
|
|
- render(
|
|
|
- <OrganizationDeveloperSettings
|
|
|
- organization={org}
|
|
|
- router={router}
|
|
|
- route={router.routes[0]}
|
|
|
- params={router.params}
|
|
|
- routeParams={router.params}
|
|
|
- location={router.location}
|
|
|
- routes={router.routes}
|
|
|
- />
|
|
|
- );
|
|
|
+ render(<OrganizationDeveloperSettings {...routerProps} organization={org} />);
|
|
|
expect(screen.queryByText('Publish')).not.toBeInTheDocument();
|
|
|
});
|
|
|
});
|
|
@@ -305,12 +243,8 @@ describe('Organization Developer Settings', function () {
|
|
|
it('trash button is disabled', async () => {
|
|
|
render(
|
|
|
<OrganizationDeveloperSettings
|
|
|
+ {...routerProps}
|
|
|
organization={newOrg}
|
|
|
- router={router}
|
|
|
- route={router.routes[0]}
|
|
|
- params={router.params}
|
|
|
- routeParams={router.params}
|
|
|
- routes={router.routes}
|
|
|
location={{...router.location, query: {type: 'public'}}}
|
|
|
/>,
|
|
|
{organization: newOrg}
|
|
@@ -322,12 +256,8 @@ describe('Organization Developer Settings', function () {
|
|
|
it('publish button is disabled', async () => {
|
|
|
render(
|
|
|
<OrganizationDeveloperSettings
|
|
|
+ {...routerProps}
|
|
|
organization={newOrg}
|
|
|
- router={router}
|
|
|
- route={router.routes[0]}
|
|
|
- params={router.params}
|
|
|
- routeParams={router.params}
|
|
|
- routes={router.routes}
|
|
|
location={{...router.location, query: {type: 'public'}}}
|
|
|
/>,
|
|
|
{organization: newOrg}
|