Added signup API endpoint
This commit is contained in:
@@ -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"
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user