Skip to content
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

Contacts: Saving banner and photos locally #1953

Merged

Conversation

shubhamkmr04
Copy link
Contributor

No description provided.

@shubhamkmr04 shubhamkmr04 changed the title Downloading banner and photos and saving them locally Saving the banner and photos locally Jan 17, 2024
@shubhamkmr04 shubhamkmr04 changed the title Saving the banner and photos locally Contacts: Saving banner and photos locally Jan 17, 2024
@shubhamkmr04 shubhamkmr04 force-pushed the shubham/download-images-before-importing branch from b65e372 to 184b093 Compare January 17, 2024 14:21
banner: contact?.banner,
isSelected: false
};
transformContactData = async (contact: any) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since transformContactData is used across files perhaps we should make a ContactUtils

package.json Outdated
@@ -99,6 +99,7 @@
"react-native-draglist": "3.5.1",
"react-native-elements": "3.4.3",
"react-native-encrypted-storage": "4.0.3",
"react-native-fs": "^2.20.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's lock in the version here

@shubhamkmr04 shubhamkmr04 force-pushed the shubham/download-images-before-importing branch from 9d46101 to 49383b5 Compare January 18, 2024 08:58
@shubhamkmr04 shubhamkmr04 force-pushed the shubham/download-images-before-importing branch from 2a20454 to 698fc29 Compare January 20, 2024 11:15
isSelected: false
});
});
it('transforms contact data properly', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change the title here or put the tests in the same block

jest.mock('react-native-fs', () => ({
DocumentDirectoryPath: '/mocked/document/directory',
downloadFile: jest.fn(() => ({ promise: Promise.resolve() }))
}));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this required if we're not processing any images?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is not required for now, but unknowingly, we get issues in the test when this mock is removed, so I decided to keep it as it will be helpful in our future implementations.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good

@shubhamkmr04 shubhamkmr04 force-pushed the shubham/download-images-before-importing branch from 698fc29 to ba50451 Compare January 20, 2024 17:39
@kaloudis kaloudis merged commit eec07ab into ZeusLN:master Jan 20, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants