Skip to content

Commit 10a70a3

Browse files
committed
Fixes tests
1 parent 24b3df0 commit 10a70a3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/core/src/js/feedback/FeedbackWidgetManager.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ abstract class FeedbackManager {
4343
} else {
4444
// This message should be always shown otherwise it's not possible to use the widget.
4545
// eslint-disable-next-line no-console
46-
console.warn(`[Sentry] ${this._feedbackComponentName} requires 'Sentry.wrap(RootComponent)' to be called before 'showFeedbackWidget()'.`);
46+
console.warn(`[Sentry] ${this._feedbackComponentName} requires 'Sentry.wrap(RootComponent)' to be called before 'show${this._feedbackComponentName}()'.`);
4747
}
4848
}
4949

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,19 +151,19 @@ describe('FeedbackButtonManager', () => {
151151
});
152152

153153
it('showFeedbackButton displays the button when FeedbackWidgetProvider is used', () => {
154-
const { findByText } = render(
154+
const { getByText } = render(
155155
<FeedbackWidgetProvider>
156156
<Text>App Components</Text>
157157
</FeedbackWidgetProvider>
158158
);
159159

160160
showFeedbackButton();
161161

162-
expect(findByText('Report a Bug')).toBeTruthy();
162+
expect(getByText('Report a Bug')).toBeTruthy();
163163
});
164164

165165
it('hideFeedbackButton hides the button', () => {
166-
const { findByText } = render(
166+
const { queryByText } = render(
167167
<FeedbackWidgetProvider>
168168
<Text>App Components</Text>
169169
</FeedbackWidgetProvider>
@@ -172,7 +172,7 @@ describe('FeedbackButtonManager', () => {
172172
showFeedbackButton();
173173
hideFeedbackButton();
174174

175-
expect(findByText('Report a Bug')).toBeNull
175+
expect(queryByText('Report a Bug')).toBeNull
176176
});
177177

178178
it('showFeedbackButton does not throw an error when FeedbackWidgetProvider is not used', () => {
@@ -184,7 +184,7 @@ describe('FeedbackButtonManager', () => {
184184
it('showFeedbackButton warns about missing feedback provider', () => {
185185
showFeedbackButton();
186186

187-
expect(consoleWarnSpy).toHaveBeenLastCalledWith(`[Sentry] FeedbackButton requires 'Sentry.wrap(RootComponent)' to be called before 'showFeedbackWidget()'.`);
187+
expect(consoleWarnSpy).toHaveBeenLastCalledWith(`[Sentry] FeedbackButton requires 'Sentry.wrap(RootComponent)' to be called before 'showFeedbackButton()'.`);
188188
});
189189

190190
it('showFeedbackButton does not warn about missing feedback provider when FeedbackWidgetProvider is used', () => {

0 commit comments

Comments
 (0)