|
|
|
@ -85,7 +85,15 @@ test('set s3 configuration', async (done) => {
@@ -85,7 +85,15 @@ test('set s3 configuration', async (done) => {
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
test('set forbidden usernames', async (done) => { |
|
|
|
|
const res = await sendConfigChangeRequest('chat/forbiddenusernames', forbiddenUsernames); |
|
|
|
|
const res = await sendConfigChangeRequest( |
|
|
|
|
'chat/forbiddenusernames', |
|
|
|
|
forbiddenUsernames |
|
|
|
|
); |
|
|
|
|
done(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
test('set hide viewer count', async (done) => { |
|
|
|
|
const res = await sendConfigChangeRequest('hideviewercount', true); |
|
|
|
|
done(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
@ -101,7 +109,7 @@ test('verify updated config values', async (done) => {
@@ -101,7 +109,7 @@ test('verify updated config values', async (done) => {
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// Test that the raw video details being broadcasted are coming through
|
|
|
|
|
test('stream details are correct', (done) => { |
|
|
|
|
test('admin stream details are correct', (done) => { |
|
|
|
|
request |
|
|
|
|
.get('/api/admin/status') |
|
|
|
|
.auth('admin', 'abc123') |
|
|
|
@ -149,7 +157,8 @@ test('admin configuration is correct', (done) => {
@@ -149,7 +157,8 @@ test('admin configuration is correct', (done) => {
|
|
|
|
|
expect(res.body.s3.secret).toBe(s3Config.secret); |
|
|
|
|
expect(res.body.s3.bucket).toBe(s3Config.bucket); |
|
|
|
|
expect(res.body.s3.region).toBe(s3Config.region); |
|
|
|
|
expect(res.body.s3.forcePathStyle).toBeTruthy(); |
|
|
|
|
expect(res.body.s3.forcePathStyle).toBe(true); |
|
|
|
|
expect(res.body.hideViewerCount).toBe(true); |
|
|
|
|
done(); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
@ -166,6 +175,16 @@ test('frontend configuration is correct', (done) => {
@@ -166,6 +175,16 @@ test('frontend configuration is correct', (done) => {
|
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
test('frontend status is correct', (done) => { |
|
|
|
|
request |
|
|
|
|
.get('/api/status') |
|
|
|
|
.expect(200) |
|
|
|
|
.then((res) => { |
|
|
|
|
expect(res.body.viewerCount).toBe(undefined); |
|
|
|
|
done(); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
async function sendConfigChangeRequest(endpoint, value) { |
|
|
|
|
const url = '/api/admin/config/' + endpoint; |
|
|
|
|
const res = await request |
|
|
|
|