|
1 |
| -import {initializeOrg} from 'sentry-test/initializeOrg'; |
2 | 1 | import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary';
|
3 | 2 |
|
4 | 3 | import * as indicators from 'sentry/actionCreators/indicator';
|
5 |
| -import OrganizationsStore from 'sentry/stores/organizationsStore'; |
6 | 4 | import type {OrgAuthToken} from 'sentry/types/user';
|
7 |
| -import {OrganizationAuthTokensNewAuthToken} from 'sentry/views/settings/organizationAuthTokens/newAuthToken'; |
| 5 | +import OrganizationAuthTokensNewAuthToken from 'sentry/views/settings/organizationAuthTokens/newAuthToken'; |
8 | 6 |
|
9 | 7 | describe('OrganizationAuthTokensNewAuthToken', function () {
|
10 | 8 | const ENDPOINT = '/organizations/org-slug/org-auth-tokens/';
|
11 |
| - const {organization, router} = initializeOrg(); |
12 |
| - |
13 |
| - const defaultProps = { |
14 |
| - organization, |
15 |
| - router, |
16 |
| - location: router.location, |
17 |
| - params: {orgId: organization.slug}, |
18 |
| - routes: router.routes, |
19 |
| - route: {}, |
20 |
| - routeParams: router.params, |
21 |
| - }; |
22 |
| - |
23 |
| - beforeEach(function () { |
24 |
| - OrganizationsStore.addOrReplace(organization); |
25 |
| - }); |
26 |
| - |
27 |
| - afterEach(function () { |
28 |
| - MockApiClient.clearMockResponses(); |
29 |
| - }); |
30 | 9 |
|
31 | 10 | it('can create token', async function () {
|
32 |
| - render(<OrganizationAuthTokensNewAuthToken {...defaultProps} />); |
| 11 | + render(<OrganizationAuthTokensNewAuthToken />); |
33 | 12 |
|
34 | 13 | const generatedToken: OrgAuthToken & {token: string} = {
|
35 | 14 | id: '1',
|
@@ -65,7 +44,7 @@ describe('OrganizationAuthTokensNewAuthToken', function () {
|
65 | 44 | it('handles API errors when creating token', async function () {
|
66 | 45 | jest.spyOn(indicators, 'addErrorMessage');
|
67 | 46 |
|
68 |
| - render(<OrganizationAuthTokensNewAuthToken {...defaultProps} />); |
| 47 | + render(<OrganizationAuthTokensNewAuthToken />); |
69 | 48 |
|
70 | 49 | const mock = MockApiClient.addMockResponse({
|
71 | 50 | url: ENDPOINT,
|
@@ -98,7 +77,7 @@ describe('OrganizationAuthTokensNewAuthToken', function () {
|
98 | 77 | it('handles missing_system_url_prefix API error when creating token', async function () {
|
99 | 78 | jest.spyOn(indicators, 'addErrorMessage');
|
100 | 79 |
|
101 |
| - render(<OrganizationAuthTokensNewAuthToken {...defaultProps} />); |
| 80 | + render(<OrganizationAuthTokensNewAuthToken />); |
102 | 81 |
|
103 | 82 | const mock = MockApiClient.addMockResponse({
|
104 | 83 | url: ENDPOINT,
|
|
0 commit comments