Skip to content

Commit 33bf13b

Browse files
committed
Updated tests
1 parent 35dff30 commit 33bf13b

File tree

4 files changed

+16
-21
lines changed

4 files changed

+16
-21
lines changed

packages/core/test/feedback/FeedbackWidgetManager.test.tsx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,9 @@ describe('FeedbackButtonManager', () => {
275275
});
276276

277277
jest.spyOn(Appearance, 'getColorScheme').mockReturnValue('dark');
278-
listener({ colorScheme: 'dark' });
278+
await act(async () => {
279+
listener({ colorScheme: 'dark' });
280+
})
279281

280282
expect(toJSON()).toMatchSnapshot();
281283
});
@@ -391,8 +393,8 @@ describe('FeedbackButtonManager', () => {
391393
jest.spyOn(Appearance, 'getColorScheme').mockReturnValue('light');
392394

393395
await act(async () => {
394-
showFeedbackWidget();
395-
});
396+
showFeedbackButton();
397+
})
396398

397399
expect(toJSON()).toMatchSnapshot();
398400
});
@@ -408,7 +410,7 @@ describe('FeedbackButtonManager', () => {
408410
jest.spyOn(Appearance, 'getColorScheme').mockReturnValue('dark');
409411

410412
await act(async () => {
411-
showFeedbackWidget();
413+
showFeedbackButton();
412414
});
413415

414416
expect(toJSON()).toMatchSnapshot();
@@ -427,11 +429,13 @@ describe('FeedbackButtonManager', () => {
427429
jest.spyOn(Appearance, 'getColorScheme').mockReturnValue('light');
428430

429431
await act(async () => {
430-
showFeedbackWidget();
432+
showFeedbackButton();
431433
});
432434

433435
jest.spyOn(Appearance, 'getColorScheme').mockReturnValue('dark');
434-
listener({ colorScheme: 'dark' });
436+
await act(async () => {
437+
listener({ colorScheme: 'dark' });
438+
});
435439

436440
expect(toJSON()).toMatchSnapshot();
437441
});
@@ -454,7 +458,7 @@ describe('FeedbackButtonManager', () => {
454458
getClient()?.addIntegration(integration);
455459

456460
await act(async () => {
457-
showFeedbackWidget();
461+
showFeedbackButton();
458462
});
459463

460464
expect(toJSON()).toMatchSnapshot();
@@ -478,7 +482,7 @@ describe('FeedbackButtonManager', () => {
478482
getClient()?.addIntegration(integration);
479483

480484
await act(async () => {
481-
showFeedbackWidget();
485+
showFeedbackButton();
482486
});
483487

484488
expect(toJSON()).toMatchSnapshot();
@@ -504,7 +508,7 @@ describe('FeedbackButtonManager', () => {
504508
jest.spyOn(Appearance, 'getColorScheme').mockReturnValue('light');
505509

506510
await act(async () => {
507-
showFeedbackWidget();
511+
showFeedbackButton();
508512
});
509513

510514
expect(toJSON()).toMatchSnapshot();
@@ -530,7 +534,7 @@ describe('FeedbackButtonManager', () => {
530534
jest.spyOn(Appearance, 'getColorScheme').mockReturnValue('dark');
531535

532536
await act(async () => {
533-
showFeedbackWidget();
537+
showFeedbackButton();
534538
});
535539

536540
expect(toJSON()).toMatchSnapshot();

packages/core/test/feedback/__snapshots__/FeedbackWidgetManager.test.tsx.snap

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,6 @@ exports[`FeedbackButtonManager the Feedback Widget matches the snapshot with cus
650650
>
651651
<Modal
652652
animationType="none"
653-
hardwareAccelerated={false}
654653
onRequestClose={[Function]}
655654
testID="feedback-form-modal"
656655
transparent={true}
@@ -1003,7 +1002,6 @@ exports[`FeedbackButtonManager the Feedback Widget matches the snapshot with cus
10031002
>
10041003
<Modal
10051004
animationType="none"
1006-
hardwareAccelerated={false}
10071005
onRequestClose={[Function]}
10081006
testID="feedback-form-modal"
10091007
transparent={true}
@@ -1356,7 +1354,6 @@ exports[`FeedbackButtonManager the Feedback Widget matches the snapshot with def
13561354
>
13571355
<Modal
13581356
animationType="none"
1359-
hardwareAccelerated={false}
13601357
onRequestClose={[Function]}
13611358
testID="feedback-form-modal"
13621359
transparent={true}
@@ -1709,7 +1706,6 @@ exports[`FeedbackButtonManager the Feedback Widget matches the snapshot with def
17091706
>
17101707
<Modal
17111708
animationType="none"
1712-
hardwareAccelerated={false}
17131709
onRequestClose={[Function]}
17141710
testID="feedback-form-modal"
17151711
transparent={true}
@@ -2062,7 +2058,6 @@ exports[`FeedbackButtonManager the Feedback Widget matches the snapshot with def
20622058
>
20632059
<Modal
20642060
animationType="none"
2065-
hardwareAccelerated={false}
20662061
onRequestClose={[Function]}
20672062
testID="feedback-form-modal"
20682063
transparent={true}
@@ -2415,7 +2410,6 @@ exports[`FeedbackButtonManager the Feedback Widget matches the snapshot with sys
24152410
>
24162411
<Modal
24172412
animationType="none"
2418-
hardwareAccelerated={false}
24192413
onRequestClose={[Function]}
24202414
testID="feedback-form-modal"
24212415
transparent={true}
@@ -2768,7 +2762,6 @@ exports[`FeedbackButtonManager the Feedback Widget matches the snapshot with sys
27682762
>
27692763
<Modal
27702764
animationType="none"
2771-
hardwareAccelerated={false}
27722765
onRequestClose={[Function]}
27732766
testID="feedback-form-modal"
27742767
transparent={true}

packages/core/test/playground/__snapshots__/modal.test.tsx.snap

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
exports[`PlaygroundComponent matches the snapshot with no props 1`] = `
44
<Modal
55
animationType="slide"
6-
hardwareAccelerated={false}
76
onRequestClose={[Function]}
87
presentationStyle="formSheet"
98
visible={true}
@@ -772,7 +771,6 @@ exports[`PlaygroundComponent matches the snapshot with no props 1`] = `
772771
exports[`PlaygroundComponent matches the snapshot with project id and organization slug 1`] = `
773772
<Modal
774773
animationType="slide"
775-
hardwareAccelerated={false}
776774
onRequestClose={[Function]}
777775
presentationStyle="formSheet"
778776
visible={true}

packages/core/test/wrap.mocked.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ describe('Sentry.wrap', () => {
116116
includeRender: true,
117117
includeUpdates: true,
118118
}),
119-
expect.anything(),
119+
expect.toBeNil()
120120
);
121121

122122
expect(ReactNativeProfiler).not.toHaveBeenCalledWith(
@@ -137,7 +137,7 @@ describe('Sentry.wrap', () => {
137137
name: 'Root',
138138
updateProps: {},
139139
}),
140-
expect.anything(),
140+
expect.toBeNil(),
141141
);
142142
});
143143
});

0 commit comments

Comments
 (0)