feat(integerations): add route to get user details (#4030)
* feat(integerations): add route to get user details * Commit updated API documentation * test(integrations): implement unit test for get user details --------- Co-authored-by: Owncast <owncast@owncast.online> Co-authored-by: Gabe Kangas <gabek@real-ity.com>
This commit is contained in:
@@ -3,6 +3,7 @@ request = request('http://127.0.0.1:8080');
|
||||
|
||||
const getAdminResponse = require('./lib/admin').getAdminResponse;
|
||||
const sendAdminPayload = require('./lib/admin').sendAdminPayload;
|
||||
const registerChat = require('./lib/chat').registerChat;
|
||||
|
||||
var accessToken = '';
|
||||
var webhookID;
|
||||
@@ -126,6 +127,16 @@ test('test fetch chat history OPTIONS request', async () => {
|
||||
.expect(204);
|
||||
});
|
||||
|
||||
test('get user details', async () => {
|
||||
const registration = await registerChat();
|
||||
const userId = registration.id;
|
||||
|
||||
await request
|
||||
.get(`/api/integrations/moderation/chat/user/${userId}`)
|
||||
.set('Authorization', 'Bearer ' + accessToken)
|
||||
.expect(200);
|
||||
});
|
||||
|
||||
test('delete access token', async () => {
|
||||
const res = await sendAdminPayload('accesstokens/delete', {
|
||||
token: accessToken,
|
||||
|
||||
Reference in New Issue
Block a user