mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-18 02:31:56 +10:00
Dashboard page: refactored setup of fetch mock, added more assertions to unit test
This commit is contained in:
@ -54,8 +54,11 @@ export const getFieldProps = (formik, schema, name) => ({
|
||||
...formik.getFieldProps(name),
|
||||
});
|
||||
|
||||
export const unsplashPhotoRequestUrl =
|
||||
'https://source.unsplash.com/featured/400x600';
|
||||
|
||||
export const getUnsplashPhoto = async () => {
|
||||
const response = await fetch('https://source.unsplash.com/featured/400x600');
|
||||
const response = await fetch(unsplashPhotoRequestUrl);
|
||||
return response.url;
|
||||
};
|
||||
|
||||
@ -121,3 +124,7 @@ export const b64toBlob = (b64Data, contentType = '', sliceSize = 512) => {
|
||||
const blob = new Blob(byteArrays, { type: contentType });
|
||||
return blob;
|
||||
};
|
||||
|
||||
export const delay = async (milliseconds) => {
|
||||
await new Promise((resolve) => setTimeout(resolve, milliseconds));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user