mirror of
https://github.com/owncast/owncast.git
synced 2025-11-01 19:32:20 +08:00
Allow adding custom javascript to the page. Closes #2604
This commit is contained in:
@ -132,6 +132,8 @@ const newFederationConfig = {
|
||||
const newHideViewerCount = !defaultHideViewerCount;
|
||||
|
||||
const overriddenWebsocketHost = 'ws://lolcalhost.biz';
|
||||
const customCSS = randomString();
|
||||
const customJavascript = randomString();
|
||||
|
||||
test('verify default config values', async (done) => {
|
||||
const res = await request.get('/api/config');
|
||||
@ -315,6 +317,16 @@ test('set custom style values', async (done) => {
|
||||
done();
|
||||
});
|
||||
|
||||
test('set custom css', async (done) => {
|
||||
await sendAdminRequest('config/customstyles', customCSS);
|
||||
done();
|
||||
});
|
||||
|
||||
test('set custom javascript', async (done) => {
|
||||
await sendAdminRequest('config/customjavascript', customJavascript);
|
||||
done();
|
||||
});
|
||||
|
||||
test('enable directory', async (done) => {
|
||||
const res = await sendAdminRequest('config/directoryenabled', true);
|
||||
done();
|
||||
@ -367,6 +379,7 @@ test('verify updated config values', async (done) => {
|
||||
expect(res.body.logo).toBe('/logo');
|
||||
expect(res.body.socialHandles).toStrictEqual(newSocialHandles);
|
||||
expect(res.body.socketHostOverride).toBe(overriddenWebsocketHost);
|
||||
expect(res.body.customStyles).toBe(customCSS);
|
||||
done();
|
||||
});
|
||||
|
||||
@ -393,6 +406,9 @@ test('verify updated admin configuration', async (done) => {
|
||||
expect(res.body.instanceDetails.socialHandles).toStrictEqual(
|
||||
newSocialHandles
|
||||
);
|
||||
expect(res.body.instanceDetails.customStyles).toBe(customCSS);
|
||||
expect(res.body.instanceDetails.customJavascript).toBe(customJavascript);
|
||||
|
||||
expect(res.body.forbiddenUsernames).toStrictEqual(newForbiddenUsernames);
|
||||
expect(res.body.streamKeys).toStrictEqual(newStreamKeys);
|
||||
expect(res.body.socketHostOverride).toBe(overriddenWebsocketHost);
|
||||
|
||||
Reference in New Issue
Block a user