Skip to content
This repository was archived by the owner on Jun 10, 2022. It is now read-only.

Add picture to UserProfile #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class UserProfileBridge implements LockReactBridge {
private static final String NAME_KEY = "name";
private static final String NICKNAME_KEY = "nickname";
private static final String CREATED_AT_KEY = "createdAt";
private static final String PICTURE_KEY = "picture";

private UserProfile profile;

Expand All @@ -62,6 +63,7 @@ public WritableMap toMap() {
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
profileMap.putString(CREATED_AT_KEY, simpleDateFormat.format(profile.getCreatedAt()));
}
profileMap.putString(PICTURE_KEY, profile.getPictureURL());
}
return profileMap;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ public void testAll() throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
userProfileMap.put("created_at", sdf.format(now));
userProfileMap.put("picture", "picture-value");
UserProfile userProfile = new UserProfile(userProfileMap);

UserProfileBridge userProfileBridge = new UserProfileBridge(userProfile);
Expand All @@ -139,5 +140,6 @@ public void testAll() throws Exception {
assertThat(map.getString("name"), is(equalTo("name-value")));
assertThat(map.getString("nickname"), is(equalTo("nickname-value")));
assertThat(map.getString("createdAt"), is(equalTo(sdf.format(now))));
assertThat(map.getString("picture"), is(equalTo("picture-value")));
}
}