-
Notifications
You must be signed in to change notification settings - Fork 24
KER-422 bug fixes part 1 #1107
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
Merged
KER-422 bug fixes part 1 #1107
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
769dc69
fix: hearingFormStep2 main image allow jpg KER-422
mikkojamG 53cecb3
fix: hearingFormStep2 main image allow 1MB KER-422
mikkojamG 233abd0
feat: imageModal replace dropzone KER-422
mikkojamG 47bfe4a
fix: phase component fix text input onChange KER-422
mikkojamG 0f8e579
chore: fileToDataUri tests KER-422
mikkojamG a88fc4d
chore: imageModal on error addToast KER-422
mikkojamG 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 was deleted.
Oops, something went wrong.
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 |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| /* eslint-disable func-names */ | ||
| import fileToDataUri from '../fileToDataUri'; | ||
|
|
||
| describe('fileToDataUri', () => { | ||
| it('should resolve to a data URI string when file reading is successful', async () => { | ||
| const mockFile = new Blob(['file content'], { type: 'text/plain' }); | ||
| const expectedDataUri = 'data:text/plain;base64,ZmlsZSBjb250ZW50'; | ||
|
|
||
| const result = await fileToDataUri(mockFile); | ||
|
|
||
| expect(result).toBe(expectedDataUri); | ||
| }); | ||
|
|
||
| it('should reject with an error when file reading fails', async () => { | ||
| const mockFile = new Blob(['file content'], { type: 'text/plain' }); | ||
| const mockError = new Error('File reading failed'); | ||
|
|
||
| jest.spyOn(FileReader.prototype, 'readAsDataURL').mockImplementation(function () { | ||
| this.onerror(mockError); | ||
| }); | ||
|
|
||
| await expect(fileToDataUri(mockFile)).rejects.toThrow('File reading failed'); | ||
| }); | ||
| }); |
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 |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import imageCompression from 'browser-image-compression'; | ||
|
|
||
| const compressFile = async (file, maxSizeMB, fileType) => imageCompression(file, { maxSizeMB, fileType }); | ||
|
|
||
| export default compressFile; |
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.