Skip to content

Commit 8a471c2

Browse files
committed
apply lint fixes
1 parent d29691c commit 8a471c2

File tree

75 files changed

+643
-758
lines changed

Some content is hidden

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

75 files changed

+643
-758
lines changed

static/app/actionCreators/savedSearches.spec.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,11 @@ describe('useFetchRecentSearches', () => {
3636
});
3737

3838
const {result} = renderHookWithProviders(
39-
() =>
40-
useFetchRecentSearches({
39+
useFetchRecentSearches,
40+
{organization, initialProps: {
4141
savedSearchType: SavedSearchType.TRACEMETRIC,
4242
namespace,
43-
}),
44-
{organization}
43+
}}
4544
);
4645

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

static/app/bootstrap/boostrapRequests.spec.tsx

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

52-
const {result} = renderHook(() => useBootstrapOrganizationQuery(orgSlug), {wrapper});
52+
const {result} = renderHook(useBootstrapOrganizationQuery, {wrapper, initialProps: orgSlug});
5353

5454
await waitFor(() => expect(result.current.data).toBeDefined());
5555
expect(JSON.stringify(OrganizationStore.get().organization)).toEqual(
@@ -64,7 +64,7 @@ describe('useBootstrapOrganizationQuery', () => {
6464
body: {},
6565
});
6666

67-
const {result} = renderHook(() => useBootstrapOrganizationQuery(orgSlug), {wrapper});
67+
const {result} = renderHook(useBootstrapOrganizationQuery, {wrapper, initialProps: orgSlug});
6868

6969
await waitFor(() => expect(result.current.error).toBeDefined());
7070
expect(OrganizationStore.get().organization).toBeNull();
@@ -75,7 +75,7 @@ describe('useBootstrapOrganizationQuery', () => {
7575
});
7676

7777
it('does not fetch when orgSlug is null', () => {
78-
const {result} = renderHook(() => useBootstrapOrganizationQuery(null), {wrapper});
78+
const {result} = renderHook(useBootstrapOrganizationQuery, {wrapper, initialProps: null});
7979
expect(result.current.data).toBeUndefined();
8080
});
8181

@@ -84,7 +84,7 @@ describe('useBootstrapOrganizationQuery', () => {
8484
orgSlug: org.slug,
8585
organization: Promise.resolve<ApiResult<Organization>>([org, undefined, undefined]),
8686
};
87-
const {result} = renderHook(() => useBootstrapOrganizationQuery(orgSlug), {wrapper});
87+
const {result} = renderHook(useBootstrapOrganizationQuery, {wrapper, initialProps: orgSlug});
8888
await waitFor(() => expect(result.current.data).toBeDefined());
8989
expect(window.__sentry_preload?.organization).toBeUndefined();
9090
});
@@ -105,7 +105,7 @@ describe('useBootstrapOrganizationQuery', () => {
105105
query: {detailed: 0, include_feature_flags: 1},
106106
});
107107

108-
const {result} = renderHook(() => useBootstrapOrganizationQuery(orgSlug), {wrapper});
108+
const {result} = renderHook(useBootstrapOrganizationQuery, {wrapper, initialProps: orgSlug});
109109
await waitFor(() => expect(result.current.data).toBeDefined());
110110
expect(JSON.stringify(OrganizationStore.get().organization?.features)).toEqual(
111111
JSON.stringify(['enable-issues'])
@@ -141,7 +141,7 @@ describe('useBootstrapTeamsQuery', () => {
141141
},
142142
});
143143

144-
const {result} = renderHook(() => useBootstrapTeamsQuery(orgSlug), {wrapper});
144+
const {result} = renderHook(useBootstrapTeamsQuery, {wrapper, initialProps: orgSlug});
145145

146146
await waitFor(() => expect(result.current.data).toBeDefined());
147147
expect(TeamStore.getState().teams).toEqual(mockTeams);
@@ -154,14 +154,14 @@ describe('useBootstrapTeamsQuery', () => {
154154
statusCode: 500,
155155
});
156156

157-
const {result} = renderHook(() => useBootstrapTeamsQuery(orgSlug), {wrapper});
157+
const {result} = renderHook(useBootstrapTeamsQuery, {wrapper, initialProps: orgSlug});
158158

159159
await waitFor(() => expect(result.current.error).toBeDefined());
160160
expect(TeamStore.getState().teams).toEqual([]);
161161
});
162162

163163
it('does not fetch when orgSlug is null', () => {
164-
const {result} = renderHook(() => useBootstrapTeamsQuery(null), {wrapper});
164+
const {result} = renderHook(useBootstrapTeamsQuery, {wrapper, initialProps: null});
165165
expect(result.current.data).toBeUndefined();
166166
});
167167
});
@@ -186,7 +186,7 @@ describe('useBootstrapProjectsQuery', () => {
186186
},
187187
});
188188

189-
const {result} = renderHook(() => useBootstrapProjectsQuery(orgSlug), {wrapper});
189+
const {result} = renderHook(useBootstrapProjectsQuery, {wrapper, initialProps: orgSlug});
190190

191191
await waitFor(() => expect(result.current.data).toBeDefined());
192192
expect(ProjectsStore.getState().projects).toEqual(mockProjects);
@@ -198,14 +198,14 @@ describe('useBootstrapProjectsQuery', () => {
198198
statusCode: 500,
199199
});
200200

201-
const {result} = renderHook(() => useBootstrapProjectsQuery(orgSlug), {wrapper});
201+
const {result} = renderHook(useBootstrapProjectsQuery, {wrapper, initialProps: orgSlug});
202202

203203
await waitFor(() => expect(result.current.error).toBeDefined());
204204
expect(ProjectsStore.getState().projects).toEqual([]);
205205
});
206206

207207
it('does not fetch when orgSlug is null', () => {
208-
const {result} = renderHook(() => useBootstrapProjectsQuery(null), {wrapper});
208+
const {result} = renderHook(useBootstrapProjectsQuery, {wrapper, initialProps: null});
209209
expect(result.current.data).toBeUndefined();
210210
});
211211
});

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ describe('useRole', () => {
2424
});
2525

2626
it('has a sufficient role', () => {
27-
const {result} = renderHookWithProviders(() => useRole({role: 'attachmentsRole'}), {
28-
organization,
27+
const {result} = renderHookWithProviders(useRole, {
28+
organization, initialProps: {role: 'attachmentsRole'},
2929
});
3030
expect(result.current.hasRole).toBe(true);
3131
expect(result.current.roleRequired).toBe('admin');
@@ -37,8 +37,8 @@ describe('useRole', () => {
3737
orgRole: 'member',
3838
});
3939
OrganizationStore.onUpdate(org, {replace: true});
40-
const {result} = renderHookWithProviders(() => useRole({role: 'attachmentsRole'}), {
41-
organization: org,
40+
const {result} = renderHookWithProviders(useRole, {
41+
organization: org, initialProps: {role: 'attachmentsRole'},
4242
});
4343
expect(result.current.hasRole).toBe(false);
4444
});
@@ -50,17 +50,17 @@ describe('useRole', () => {
5050
access: ['org:superuser'],
5151
});
5252
OrganizationStore.onUpdate(org, {replace: true});
53-
const {result} = renderHookWithProviders(() => useRole({role: 'attachmentsRole'}), {
54-
organization: org,
53+
const {result} = renderHookWithProviders(useRole, {
54+
organization: org, initialProps: {role: 'attachmentsRole'},
5555
});
5656
expect(result.current.hasRole).toBe(true);
5757
});
5858

5959
it('handles no organization.orgRoleList', () => {
6060
const org = {...organization, orgRoleList: []};
6161
OrganizationStore.onUpdate(org, {replace: true});
62-
const {result} = renderHookWithProviders(() => useRole({role: 'attachmentsRole'}), {
63-
organization: org,
62+
const {result} = renderHookWithProviders(useRole, {
63+
organization: org, initialProps: {role: 'attachmentsRole'},
6464
});
6565
expect(result.current.hasRole).toBe(false);
6666
});

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

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

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

4948
expect(result.current.brush).toBeDefined();
5049
expect(result.current.toolBox).toBeDefined();
5150
});
5251

5352
it('should return undefined brush when disabled', () => {
54-
const {result} = renderHook(() =>
55-
useChartXRangeSelection({
53+
const {result} = renderHook(useChartXRangeSelection, {initialProps: {
5654
chartRef: mockChartRef,
5755
disabled: true,
58-
})
56+
}}
5957
);
6058

6159
expect(result.current.brush).toBeUndefined();
@@ -67,11 +65,10 @@ describe('useChartXRangeSelection', () => {
6765
it('should hide tooltip when brush starts', () => {
6866
const onSelectionStart = jest.fn();
6967

70-
const {result} = renderHook(() =>
71-
useChartXRangeSelection({
68+
const {result} = renderHook(useChartXRangeSelection, {initialProps: {
7269
chartRef: mockChartRef,
7370
onSelectionStart,
74-
})
71+
}}
7572
);
7673

7774
act(() => {
@@ -88,11 +85,10 @@ describe('useChartXRangeSelection', () => {
8885
const disconnectSpy = jest.fn();
8986
jest.spyOn(require('echarts'), 'disconnect').mockImplementation(disconnectSpy);
9087

91-
const {result} = renderHook(() =>
92-
useChartXRangeSelection({
88+
const {result} = renderHook(useChartXRangeSelection, {initialProps: {
9389
chartRef: mockChartRef,
9490
chartsGroupName: 'test-group',
95-
})
91+
}}
9692
);
9793

9894
act(() => {
@@ -144,11 +140,10 @@ describe('useChartXRangeSelection', () => {
144140
getEchartsInstance: () => mockEchartsInstance,
145141
} as unknown as EChartsReact;
146142

147-
const {result} = renderHook(() =>
148-
useChartXRangeSelection({
143+
const {result} = renderHook(useChartXRangeSelection, {initialProps: {
149144
chartRef: mockChartRef,
150145
onSelectionEnd,
151-
})
146+
}}
152147
);
153148

154149
const mockEvent = {
@@ -213,11 +208,10 @@ describe('useChartXRangeSelection', () => {
213208
getEchartsInstance: () => mockEchartsInstance,
214209
} as unknown as EChartsReact;
215210

216-
const {result} = renderHook(() =>
217-
useChartXRangeSelection({
211+
const {result} = renderHook(useChartXRangeSelection, {initialProps: {
218212
chartRef: mockChartRef,
219213
onSelectionEnd,
220-
})
214+
}}
221215
);
222216

223217
const mockEvent = {
@@ -276,11 +270,10 @@ describe('useChartXRangeSelection', () => {
276270
getEchartsInstance: () => mockEchartsInstance,
277271
} as unknown as EChartsReact;
278272

279-
const {result} = renderHook(() =>
280-
useChartXRangeSelection({
273+
const {result} = renderHook(useChartXRangeSelection, {initialProps: {
281274
chartRef: mockChartRef,
282275
chartsGroupName: 'test-group',
283-
})
276+
}}
284277
);
285278

286279
const mockEvent = {
@@ -328,11 +321,10 @@ describe('useChartXRangeSelection', () => {
328321
<div data-test-id="action-menu">Action Menu</div>
329322
));
330323

331-
const {result} = renderHook(() =>
332-
useChartXRangeSelection({
324+
const {result} = renderHook(useChartXRangeSelection, {initialProps: {
333325
chartRef: mockChartRef,
334326
actionMenuRenderer,
335-
})
327+
}}
336328
);
337329

338330
act(() => {
@@ -390,13 +382,12 @@ describe('useChartXRangeSelection', () => {
390382
getEchartsInstance: () => mockEchartsInstance,
391383
} as unknown as EChartsReact;
392384

393-
const {result} = renderHook(() =>
394-
useChartXRangeSelection({
385+
const {result} = renderHook(useChartXRangeSelection, {initialProps: {
395386
chartRef: mockChartRef,
396387
actionMenuRenderer: _params => (
397388
<div data-test-id="action-menu">Action Menu</div>
398389
),
399-
})
390+
}}
400391
);
401392

402393
act(() => {
@@ -423,10 +414,9 @@ describe('useChartXRangeSelection', () => {
423414
getEchartsInstance: () => mockEchartsInstance,
424415
} as unknown as EChartsReact;
425416

426-
renderHook(() =>
427-
useChartXRangeSelection({
417+
renderHook(useChartXRangeSelection, {initialProps: {
428418
chartRef: mockChartRef,
429-
})
419+
}}
430420
);
431421

432422
await waitFor(() => {
@@ -508,11 +498,10 @@ describe('useChartXRangeSelection', () => {
508498
panelId: 'initial-panel-id',
509499
};
510500

511-
renderHook(() =>
512-
useChartXRangeSelection({
501+
renderHook(useChartXRangeSelection, {initialProps: {
513502
chartRef: mockChartRef,
514503
initialSelection,
515-
})
504+
}}
516505
);
517506

518507
await waitFor(() => {
@@ -713,11 +702,10 @@ describe('useChartXRangeSelection', () => {
713702
getEchartsInstance: () => mockEchartsInstance,
714703
} as unknown as EChartsReact;
715704

716-
const {result} = renderHook(() =>
717-
useChartXRangeSelection({
705+
const {result} = renderHook(useChartXRangeSelection, {initialProps: {
718706
chartRef: mockChartRef,
719707
onInsideSelectionClick,
720-
})
708+
}}
721709
);
722710

723711
// Create a selection first
@@ -794,11 +782,10 @@ describe('useChartXRangeSelection', () => {
794782
getEchartsInstance: () => mockEchartsInstance,
795783
} as unknown as EChartsReact;
796784

797-
const {result} = renderHook(() =>
798-
useChartXRangeSelection({
785+
const {result} = renderHook(useChartXRangeSelection, {initialProps: {
799786
chartRef: mockChartRef,
800787
onOutsideSelectionClick,
801-
})
788+
}}
802789
);
803790

804791
// Create a selection first
@@ -873,11 +860,10 @@ describe('useChartXRangeSelection', () => {
873860
getEchartsInstance: () => mockEchartsInstance,
874861
} as unknown as EChartsReact;
875862

876-
const {result} = renderHook(() =>
877-
useChartXRangeSelection({
863+
const {result} = renderHook(useChartXRangeSelection, {initialProps: {
878864
chartRef: mockChartRef,
879865
onOutsideSelectionClick,
880-
})
866+
}}
881867
);
882868

883869
// Create a selection first

0 commit comments

Comments
 (0)