Skip to content

Commit ab9304e

Browse files
🛠️ apply pre-commit fixes
1 parent 8a471c2 commit ab9304e

File tree

55 files changed

+958
-886
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+958
-886
lines changed

static/app/actionCreators/savedSearches.spec.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ describe('useFetchRecentSearches', () => {
3535
],
3636
});
3737

38-
const {result} = renderHookWithProviders(
39-
useFetchRecentSearches,
40-
{organization, initialProps: {
41-
savedSearchType: SavedSearchType.TRACEMETRIC,
42-
namespace,
43-
}}
44-
);
38+
const {result} = renderHookWithProviders(useFetchRecentSearches, {
39+
organization,
40+
initialProps: {
41+
savedSearchType: SavedSearchType.TRACEMETRIC,
42+
namespace,
43+
},
44+
});
4545

4646
await waitFor(() => expect(result.current.isSuccess).toBe(true));
4747

static/app/bootstrap/boostrapRequests.spec.tsx

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ describe('useBootstrapOrganizationQuery', () => {
4949
query: {detailed: 0, include_feature_flags: 1},
5050
});
5151

52-
const {result} = renderHook(useBootstrapOrganizationQuery, {wrapper, initialProps: orgSlug});
52+
const {result} = renderHook(useBootstrapOrganizationQuery, {
53+
wrapper,
54+
initialProps: orgSlug,
55+
});
5356

5457
await waitFor(() => expect(result.current.data).toBeDefined());
5558
expect(JSON.stringify(OrganizationStore.get().organization)).toEqual(
@@ -64,7 +67,10 @@ describe('useBootstrapOrganizationQuery', () => {
6467
body: {},
6568
});
6669

67-
const {result} = renderHook(useBootstrapOrganizationQuery, {wrapper, initialProps: orgSlug});
70+
const {result} = renderHook(useBootstrapOrganizationQuery, {
71+
wrapper,
72+
initialProps: orgSlug,
73+
});
6874

6975
await waitFor(() => expect(result.current.error).toBeDefined());
7076
expect(OrganizationStore.get().organization).toBeNull();
@@ -75,7 +81,10 @@ describe('useBootstrapOrganizationQuery', () => {
7581
});
7682

7783
it('does not fetch when orgSlug is null', () => {
78-
const {result} = renderHook(useBootstrapOrganizationQuery, {wrapper, initialProps: null});
84+
const {result} = renderHook(useBootstrapOrganizationQuery, {
85+
wrapper,
86+
initialProps: null,
87+
});
7988
expect(result.current.data).toBeUndefined();
8089
});
8190

@@ -84,7 +93,10 @@ describe('useBootstrapOrganizationQuery', () => {
8493
orgSlug: org.slug,
8594
organization: Promise.resolve<ApiResult<Organization>>([org, undefined, undefined]),
8695
};
87-
const {result} = renderHook(useBootstrapOrganizationQuery, {wrapper, initialProps: orgSlug});
96+
const {result} = renderHook(useBootstrapOrganizationQuery, {
97+
wrapper,
98+
initialProps: orgSlug,
99+
});
88100
await waitFor(() => expect(result.current.data).toBeDefined());
89101
expect(window.__sentry_preload?.organization).toBeUndefined();
90102
});
@@ -105,7 +117,10 @@ describe('useBootstrapOrganizationQuery', () => {
105117
query: {detailed: 0, include_feature_flags: 1},
106118
});
107119

108-
const {result} = renderHook(useBootstrapOrganizationQuery, {wrapper, initialProps: orgSlug});
120+
const {result} = renderHook(useBootstrapOrganizationQuery, {
121+
wrapper,
122+
initialProps: orgSlug,
123+
});
109124
await waitFor(() => expect(result.current.data).toBeDefined());
110125
expect(JSON.stringify(OrganizationStore.get().organization?.features)).toEqual(
111126
JSON.stringify(['enable-issues'])
@@ -186,7 +201,10 @@ describe('useBootstrapProjectsQuery', () => {
186201
},
187202
});
188203

189-
const {result} = renderHook(useBootstrapProjectsQuery, {wrapper, initialProps: orgSlug});
204+
const {result} = renderHook(useBootstrapProjectsQuery, {
205+
wrapper,
206+
initialProps: orgSlug,
207+
});
190208

191209
await waitFor(() => expect(result.current.data).toBeDefined());
192210
expect(ProjectsStore.getState().projects).toEqual(mockProjects);
@@ -198,7 +216,10 @@ describe('useBootstrapProjectsQuery', () => {
198216
statusCode: 500,
199217
});
200218

201-
const {result} = renderHook(useBootstrapProjectsQuery, {wrapper, initialProps: orgSlug});
219+
const {result} = renderHook(useBootstrapProjectsQuery, {
220+
wrapper,
221+
initialProps: orgSlug,
222+
});
202223

203224
await waitFor(() => expect(result.current.error).toBeDefined());
204225
expect(ProjectsStore.getState().projects).toEqual([]);

static/app/components/acl/useRole.spec.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ describe('useRole', () => {
2525

2626
it('has a sufficient role', () => {
2727
const {result} = renderHookWithProviders(useRole, {
28-
organization, initialProps: {role: 'attachmentsRole'},
28+
organization,
29+
initialProps: {role: 'attachmentsRole'},
2930
});
3031
expect(result.current.hasRole).toBe(true);
3132
expect(result.current.roleRequired).toBe('admin');
@@ -38,7 +39,8 @@ describe('useRole', () => {
3839
});
3940
OrganizationStore.onUpdate(org, {replace: true});
4041
const {result} = renderHookWithProviders(useRole, {
41-
organization: org, initialProps: {role: 'attachmentsRole'},
42+
organization: org,
43+
initialProps: {role: 'attachmentsRole'},
4244
});
4345
expect(result.current.hasRole).toBe(false);
4446
});
@@ -51,7 +53,8 @@ describe('useRole', () => {
5153
});
5254
OrganizationStore.onUpdate(org, {replace: true});
5355
const {result} = renderHookWithProviders(useRole, {
54-
organization: org, initialProps: {role: 'attachmentsRole'},
56+
organization: org,
57+
initialProps: {role: 'attachmentsRole'},
5558
});
5659
expect(result.current.hasRole).toBe(true);
5760
});
@@ -60,7 +63,8 @@ describe('useRole', () => {
6063
const org = {...organization, orgRoleList: []};
6164
OrganizationStore.onUpdate(org, {replace: true});
6265
const {result} = renderHookWithProviders(useRole, {
63-
organization: org, initialProps: {role: 'attachmentsRole'},
66+
organization: org,
67+
initialProps: {role: 'attachmentsRole'},
6468
});
6569
expect(result.current.hasRole).toBe(false);
6670
});

static/app/components/charts/useChartXRangeSelection.spec.tsx

Lines changed: 56 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,23 @@ describe('useChartXRangeSelection', () => {
4040

4141
describe('initial state', () => {
4242
it('should return brush configuration when not disabled', () => {
43-
const {result} = renderHook(useChartXRangeSelection, {initialProps: {
43+
const {result} = renderHook(useChartXRangeSelection, {
44+
initialProps: {
4445
chartRef: mockChartRef,
45-
}}
46-
);
46+
},
47+
});
4748

4849
expect(result.current.brush).toBeDefined();
4950
expect(result.current.toolBox).toBeDefined();
5051
});
5152

5253
it('should return undefined brush when disabled', () => {
53-
const {result} = renderHook(useChartXRangeSelection, {initialProps: {
54+
const {result} = renderHook(useChartXRangeSelection, {
55+
initialProps: {
5456
chartRef: mockChartRef,
5557
disabled: true,
56-
}}
57-
);
58+
},
59+
});
5860

5961
expect(result.current.brush).toBeUndefined();
6062
expect(result.current.toolBox).toBeUndefined();
@@ -65,11 +67,12 @@ describe('useChartXRangeSelection', () => {
6567
it('should hide tooltip when brush starts', () => {
6668
const onSelectionStart = jest.fn();
6769

68-
const {result} = renderHook(useChartXRangeSelection, {initialProps: {
70+
const {result} = renderHook(useChartXRangeSelection, {
71+
initialProps: {
6972
chartRef: mockChartRef,
7073
onSelectionStart,
71-
}}
72-
);
74+
},
75+
});
7376

7477
act(() => {
7578
result.current.onBrushStart({} as any, mockChartInstance);
@@ -85,11 +88,12 @@ describe('useChartXRangeSelection', () => {
8588
const disconnectSpy = jest.fn();
8689
jest.spyOn(require('echarts'), 'disconnect').mockImplementation(disconnectSpy);
8790

88-
const {result} = renderHook(useChartXRangeSelection, {initialProps: {
91+
const {result} = renderHook(useChartXRangeSelection, {
92+
initialProps: {
8993
chartRef: mockChartRef,
9094
chartsGroupName: 'test-group',
91-
}}
92-
);
95+
},
96+
});
9397

9498
act(() => {
9599
result.current.onBrushStart({} as any, mockChartInstance);
@@ -140,11 +144,12 @@ describe('useChartXRangeSelection', () => {
140144
getEchartsInstance: () => mockEchartsInstance,
141145
} as unknown as EChartsReact;
142146

143-
const {result} = renderHook(useChartXRangeSelection, {initialProps: {
147+
const {result} = renderHook(useChartXRangeSelection, {
148+
initialProps: {
144149
chartRef: mockChartRef,
145150
onSelectionEnd,
146-
}}
147-
);
151+
},
152+
});
148153

149154
const mockEvent = {
150155
areas: [
@@ -208,11 +213,12 @@ describe('useChartXRangeSelection', () => {
208213
getEchartsInstance: () => mockEchartsInstance,
209214
} as unknown as EChartsReact;
210215

211-
const {result} = renderHook(useChartXRangeSelection, {initialProps: {
216+
const {result} = renderHook(useChartXRangeSelection, {
217+
initialProps: {
212218
chartRef: mockChartRef,
213219
onSelectionEnd,
214-
}}
215-
);
220+
},
221+
});
216222

217223
const mockEvent = {
218224
areas: [
@@ -270,11 +276,12 @@ describe('useChartXRangeSelection', () => {
270276
getEchartsInstance: () => mockEchartsInstance,
271277
} as unknown as EChartsReact;
272278

273-
const {result} = renderHook(useChartXRangeSelection, {initialProps: {
279+
const {result} = renderHook(useChartXRangeSelection, {
280+
initialProps: {
274281
chartRef: mockChartRef,
275282
chartsGroupName: 'test-group',
276-
}}
277-
);
283+
},
284+
});
278285

279286
const mockEvent = {
280287
areas: [{coordRange: [10, 90], panelId: 'test-panel-id'}],
@@ -321,11 +328,12 @@ describe('useChartXRangeSelection', () => {
321328
<div data-test-id="action-menu">Action Menu</div>
322329
));
323330

324-
const {result} = renderHook(useChartXRangeSelection, {initialProps: {
331+
const {result} = renderHook(useChartXRangeSelection, {
332+
initialProps: {
325333
chartRef: mockChartRef,
326334
actionMenuRenderer,
327-
}}
328-
);
335+
},
336+
});
329337

330338
act(() => {
331339
result.current.onBrushEnd(
@@ -382,13 +390,14 @@ describe('useChartXRangeSelection', () => {
382390
getEchartsInstance: () => mockEchartsInstance,
383391
} as unknown as EChartsReact;
384392

385-
const {result} = renderHook(useChartXRangeSelection, {initialProps: {
393+
const {result} = renderHook(useChartXRangeSelection, {
394+
initialProps: {
386395
chartRef: mockChartRef,
387396
actionMenuRenderer: _params => (
388397
<div data-test-id="action-menu">Action Menu</div>
389398
),
390-
}}
391-
);
399+
},
400+
});
392401

393402
act(() => {
394403
result.current.onBrushEnd(
@@ -414,10 +423,11 @@ describe('useChartXRangeSelection', () => {
414423
getEchartsInstance: () => mockEchartsInstance,
415424
} as unknown as EChartsReact;
416425

417-
renderHook(useChartXRangeSelection, {initialProps: {
426+
renderHook(useChartXRangeSelection, {
427+
initialProps: {
418428
chartRef: mockChartRef,
419-
}}
420-
);
429+
},
430+
});
421431

422432
await waitFor(() => {
423433
expect(mockEchartsInstance.dispatchAction).toHaveBeenCalledWith({
@@ -498,11 +508,12 @@ describe('useChartXRangeSelection', () => {
498508
panelId: 'initial-panel-id',
499509
};
500510

501-
renderHook(useChartXRangeSelection, {initialProps: {
511+
renderHook(useChartXRangeSelection, {
512+
initialProps: {
502513
chartRef: mockChartRef,
503514
initialSelection,
504-
}}
505-
);
515+
},
516+
});
506517

507518
await waitFor(() => {
508519
expect(mockEchartsInstance.dispatchAction).toHaveBeenCalledWith({
@@ -702,11 +713,12 @@ describe('useChartXRangeSelection', () => {
702713
getEchartsInstance: () => mockEchartsInstance,
703714
} as unknown as EChartsReact;
704715

705-
const {result} = renderHook(useChartXRangeSelection, {initialProps: {
716+
const {result} = renderHook(useChartXRangeSelection, {
717+
initialProps: {
706718
chartRef: mockChartRef,
707719
onInsideSelectionClick,
708-
}}
709-
);
720+
},
721+
});
710722

711723
// Create a selection first
712724
act(() => {
@@ -782,11 +794,12 @@ describe('useChartXRangeSelection', () => {
782794
getEchartsInstance: () => mockEchartsInstance,
783795
} as unknown as EChartsReact;
784796

785-
const {result} = renderHook(useChartXRangeSelection, {initialProps: {
797+
const {result} = renderHook(useChartXRangeSelection, {
798+
initialProps: {
786799
chartRef: mockChartRef,
787800
onOutsideSelectionClick,
788-
}}
789-
);
801+
},
802+
});
790803

791804
// Create a selection first
792805
act(() => {
@@ -860,11 +873,12 @@ describe('useChartXRangeSelection', () => {
860873
getEchartsInstance: () => mockEchartsInstance,
861874
} as unknown as EChartsReact;
862875

863-
const {result} = renderHook(useChartXRangeSelection, {initialProps: {
876+
const {result} = renderHook(useChartXRangeSelection, {
877+
initialProps: {
864878
chartRef: mockChartRef,
865879
onOutsideSelectionClick,
866-
}}
867-
);
880+
},
881+
});
868882

869883
// Create a selection first
870884
act(() => {

0 commit comments

Comments
 (0)