Added signup API endpoint

This commit is contained in:
Jori Lallo
2016-09-11 16:34:57 -07:00
parent bf84f792e2
commit 48a9a9f285
11 changed files with 265 additions and 8 deletions

View File

@@ -6,3 +6,12 @@ Object {
"username": "testuser"
}
`;
exports[`test presents a user without slack data 1`] = `
Object {
"avatarUrl": null,
"id": "123",
"name": "Test User",
"username": "testuser"
}
`;

View File

@@ -4,9 +4,9 @@ const presentUser = (ctx, user) => {
return new Promise(async (resolve, _reject) => {
const data = {
id: user.id,
name: user.name,
username: user.username,
avatarUrl: user.slackData.image_192,
name: user.name,
avatarUrl: user.slackData ? user.slackData.image_192 : null,
};
resolve(data);
});

View File

@@ -17,3 +17,17 @@ it('presents a user', async () => {
expect(user).toMatchSnapshot();
});
it('presents a user without slack data', async () => {
const user = await presentUser(
ctx,
{
id: '123',
name: 'Test User',
username: 'testuser',
slackData: null,
},
);
expect(user).toMatchSnapshot();
});