-
-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'antonis/4358-Feedback-Form-Autoinject' into antonis/435…
…8-Feedback-Form-Autoinject-Button
- Loading branch information
Showing
11 changed files
with
147 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,19 +22,11 @@ | |
email: "[email protected]", | ||
message: "Hello World!", | ||
associatedEventId: eventId, // optional | ||
}, { | ||
captureContext: { | ||
tags: { "tag-key": "tag-value" }, | ||
}, | ||
attachments: [ | ||
{ | ||
filename: 'hello.txt', | ||
data: 'Hello, World!', | ||
}, | ||
], | ||
}); | ||
``` | ||
|
||
To learn how to attach context data to the feedback visit [the documentation](https://docs.sentry.io/platforms/react-native/user-feedback/). | ||
|
||
- User Feedback Form Component Beta ([#4320](https://github.com/getsentry/sentry-react-native/pull/4328)) | ||
|
||
To collect user feedback from inside your application you can use: | ||
|
@@ -67,6 +59,7 @@ | |
``` | ||
|
||
- Export `Span` type from `@sentry/types` ([#4345](https://github.com/getsentry/sentry-react-native/pull/4345)) | ||
- Add RN SDK package to `sdk.packages` on Android ([#4380](https://github.com/getsentry/sentry-react-native/pull/4380)) | ||
|
||
### Fixes | ||
|
||
|
@@ -87,9 +80,9 @@ | |
- Bump Android SDK from v7.18.0 to v7.19.0 ([#4329](https://github.com/getsentry/sentry-react-native/pull/4329), [#4365](https://github.com/getsentry/sentry-react-native/pull/4365)) | ||
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#7190) | ||
- [diff](https://github.com/getsentry/sentry-java/compare/7.18.0...7.19.0) | ||
- Bump JavaScript SDK from v8.40.0 to v8.45.0 ([#4351](https://github.com/getsentry/sentry-react-native/pull/4351), [#4325](https://github.com/getsentry/sentry-react-native/pull/4325), [#4371](https://github.com/getsentry/sentry-react-native/pull/4371)) | ||
- [changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#8450) | ||
- [diff](https://github.com/getsentry/sentry-javascript/compare/8.40.0...8.45.0) | ||
- Bump JavaScript SDK from v8.40.0 to v8.45.1 ([#4351](https://github.com/getsentry/sentry-react-native/pull/4351), [#4325](https://github.com/getsentry/sentry-react-native/pull/4325), [#4371](https://github.com/getsentry/sentry-react-native/pull/4371), [#4382](https://github.com/getsentry/sentry-react-native/pull/4382)) | ||
- [changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#8451) | ||
- [diff](https://github.com/getsentry/sentry-javascript/compare/8.40.0...8.45.1) | ||
|
||
## 6.4.0 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
packages/core/android/src/main/java/io/sentry/react/RNSentryVersion.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package io.sentry.react; | ||
|
||
class RNSentryVersion { | ||
static final String REACT_NATIVE_SDK_PACKAGE_NAME = "npm:@sentry/react-native"; | ||
static final String REACT_NATIVE_SDK_PACKAGE_VERSION = "6.4.0"; | ||
static final String NATIVE_SDK_NAME = "sentry.native.android.react-native"; | ||
static final String ANDROID_SDK_NAME = "sentry.java.android.react-native"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,16 +7,17 @@ import { FeedbackForm } from '../../src/js/feedback/FeedbackForm'; | |
import type { FeedbackFormProps } from '../../src/js/feedback/FeedbackForm.types'; | ||
|
||
const mockOnFormClose = jest.fn(); | ||
const mockGetUser = jest.fn(() => ({ | ||
email: '[email protected]', | ||
name: 'Test User', | ||
})); | ||
|
||
jest.spyOn(Alert, 'alert'); | ||
|
||
jest.mock('@sentry/core', () => ({ | ||
captureFeedback: jest.fn(), | ||
getCurrentScope: jest.fn(() => ({ | ||
getUser: jest.fn(() => ({ | ||
email: '[email protected]', | ||
name: 'Test User', | ||
})), | ||
getUser: mockGetUser, | ||
})), | ||
lastEventId: jest.fn(), | ||
})); | ||
|
@@ -68,6 +69,17 @@ describe('FeedbackForm', () => { | |
expect(emailInput.props.value).toBe('[email protected]'); | ||
}); | ||
|
||
it('ensure getUser is called only after the component is rendered', () => { | ||
// Ensure getUser is not called before render | ||
expect(mockGetUser).not.toHaveBeenCalled(); | ||
|
||
// Render the component | ||
render(<FeedbackForm />); | ||
|
||
// After rendering, check that getUser was called twice (email and name) | ||
expect(mockGetUser).toHaveBeenCalledTimes(2); | ||
}); | ||
|
||
it('shows an error message if required fields are empty', async () => { | ||
const { getByText } = render(<FeedbackForm {...defaultProps} />); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.