-
-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
15 additions
and
14 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
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,7 +7,7 @@ import { FeedbackForm } from '../../src/js/feedback/FeedbackForm'; | |
import type { FeedbackFormProps } from '../../src/js/feedback/FeedbackForm.types'; | ||
|
||
const mockOnFormClose = jest.fn(); | ||
const mockOnFileChosen = jest.fn(); | ||
const mockOnAddScreenshot = jest.fn(); | ||
const mockGetUser = jest.fn(() => ({ | ||
email: '[email protected]', | ||
name: 'Test User', | ||
|
@@ -25,7 +25,7 @@ jest.mock('@sentry/core', () => ({ | |
|
||
const defaultProps: FeedbackFormProps = { | ||
onFormClose: mockOnFormClose, | ||
onFileChosen: mockOnFileChosen, | ||
onAddScreenshot: mockOnAddScreenshot, | ||
addScreenshotButtonLabel: 'Add Screenshot', | ||
formTitle: 'Feedback Form', | ||
nameLabel: 'Name', | ||
|
@@ -168,13 +168,13 @@ describe('FeedbackForm', () => { | |
}); | ||
}); | ||
|
||
it('calls onFileChosen when the screenshot button is pressed', async () => { | ||
it('calls onAddScreenshot when the screenshot button is pressed', async () => { | ||
const { getByText } = render(<FeedbackForm {...defaultProps} enableScreenshot={true} />); | ||
|
||
fireEvent.press(getByText(defaultProps.addScreenshotButtonLabel)); | ||
|
||
await waitFor(() => { | ||
expect(mockOnFileChosen).toHaveBeenCalled(); | ||
expect(mockOnAddScreenshot).toHaveBeenCalled(); | ||
}); | ||
}); | ||
|
||
|
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