-
-
Notifications
You must be signed in to change notification settings - Fork 344
feat(feedback): Use only image uri in the onAddScreenshot callback #4546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
antonis
merged 20 commits into
feedback-ui
from
antonis/feedback-simplify-onaddscreenshot
Feb 18, 2025
Merged
Changes from 3 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
38a6085
Save form state for unsubmitted data
antonis 56a113e
Show selected screenshot
antonis d2dd1f3
Use image uri instead of UInt8Array in onAddScreenshot callback
antonis 9212cb8
Merge branch 'feedback-ui' into antonis/feedback-save-state
antonis 1efb23e
Omit isVisible from state
antonis 59f2f57
Save/clear form state on unmount
antonis 797611f
Pass the missing attachment parameter in the onSubmitSuccess
antonis dbf8c90
Merge branch 'antonis/feedback-save-state' into antonis/feedback-show…
antonis 91117e3
Merge branch 'antonis/feedback-show-screenshot' into antonis/feedback…
antonis f14197d
Use only the uri parameter for the onAddScreenshot callback
antonis e63ee11
Merge branch 'feedback-ui' into antonis/feedback-save-state
antonis f220540
Merge branch 'antonis/feedback-save-state' into antonis/feedback-show…
antonis aae3a98
Merge branch 'antonis/feedback-show-screenshot' into antonis/feedback…
antonis f17106e
Use instance variable for _didSubmitForm
antonis f95ed97
Fixed callback function parameter name for clarity
antonis 869f22b
Merge branch 'antonis/feedback-save-state' into antonis/feedback-show…
antonis 6e2d6ec
Fixes lint issue
antonis 082ef57
Merge branch 'antonis/feedback-save-state' into antonis/feedback-show…
antonis e5a9bcc
Merge branch 'antonis/feedback-show-screenshot' into antonis/feedback…
antonis 6ca97ad
Merge branch 'feedback-ui' into antonis/feedback-simplify-onaddscreen…
antonis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -354,4 +354,34 @@ describe('FeedbackForm', () => { | |
|
||
expect(mockOnFormClose).toHaveBeenCalled(); | ||
}); | ||
|
||
it('onCancel the input is saved and restored when the form reopens', async () => { | ||
const { getByPlaceholderText, getByText } = render(<FeedbackForm {...defaultProps} />); | ||
|
||
fireEvent.changeText(getByPlaceholderText(defaultProps.namePlaceholder), 'John Doe'); | ||
fireEvent.changeText(getByPlaceholderText(defaultProps.emailPlaceholder), '[email protected]'); | ||
fireEvent.changeText(getByPlaceholderText(defaultProps.messagePlaceholder), 'This is a feedback message.'); | ||
|
||
fireEvent.press(getByText(defaultProps.cancelButtonLabel)); | ||
const { queryByPlaceholderText } = render(<FeedbackForm {...defaultProps} />); | ||
|
||
expect(queryByPlaceholderText(defaultProps.namePlaceholder).props.value).toBe('John Doe'); | ||
expect(queryByPlaceholderText(defaultProps.emailPlaceholder).props.value).toBe('[email protected]'); | ||
expect(queryByPlaceholderText(defaultProps.messagePlaceholder).props.value).toBe('This is a feedback message.'); | ||
}); | ||
|
||
it('onSubmit the saved input is cleared and not restored when the form reopens', async () => { | ||
const { getByPlaceholderText, getByText } = render(<FeedbackForm {...defaultProps} />); | ||
|
||
fireEvent.changeText(getByPlaceholderText(defaultProps.namePlaceholder), 'John Doe'); | ||
fireEvent.changeText(getByPlaceholderText(defaultProps.emailPlaceholder), '[email protected]'); | ||
fireEvent.changeText(getByPlaceholderText(defaultProps.messagePlaceholder), 'This is a feedback message.'); | ||
|
||
fireEvent.press(getByText(defaultProps.submitButtonLabel)); | ||
const { queryByPlaceholderText } = render(<FeedbackForm {...defaultProps} />); | ||
|
||
expect(queryByPlaceholderText(defaultProps.namePlaceholder).props.value).toBe('Test User'); | ||
expect(queryByPlaceholderText(defaultProps.emailPlaceholder).props.value).toBe('[email protected]'); | ||
expect(queryByPlaceholderText(defaultProps.messagePlaceholder).props.value).toBe(''); | ||
}); | ||
}); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.