diff options
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/api/check-params/config.ts | 6 | ||||
-rw-r--r-- | server/tests/api/server/config.ts | 16 |
2 files changed, 22 insertions, 0 deletions
diff --git a/server/tests/api/check-params/config.ts b/server/tests/api/check-params/config.ts index f1a79806b..7c96fa762 100644 --- a/server/tests/api/check-params/config.ts +++ b/server/tests/api/check-params/config.ts | |||
@@ -133,6 +133,12 @@ describe('Test config API validators', function () { | |||
133 | indexUrl: 'https://index.example.com' | 133 | indexUrl: 'https://index.example.com' |
134 | } | 134 | } |
135 | } | 135 | } |
136 | }, | ||
137 | broadcastMessage: { | ||
138 | enabled: true, | ||
139 | dismissable: true, | ||
140 | message: 'super message', | ||
141 | level: 'warning' | ||
136 | } | 142 | } |
137 | } | 143 | } |
138 | 144 | ||
diff --git a/server/tests/api/server/config.ts b/server/tests/api/server/config.ts index 8580835d6..d18a93082 100644 --- a/server/tests/api/server/config.ts +++ b/server/tests/api/server/config.ts | |||
@@ -87,6 +87,11 @@ function checkInitialConfig (server: ServerInfo, data: CustomConfig) { | |||
87 | expect(data.followings.instance.autoFollowBack.enabled).to.be.false | 87 | expect(data.followings.instance.autoFollowBack.enabled).to.be.false |
88 | expect(data.followings.instance.autoFollowIndex.enabled).to.be.false | 88 | expect(data.followings.instance.autoFollowIndex.enabled).to.be.false |
89 | expect(data.followings.instance.autoFollowIndex.indexUrl).to.equal('') | 89 | expect(data.followings.instance.autoFollowIndex.indexUrl).to.equal('') |
90 | |||
91 | expect(data.broadcastMessage.enabled).to.be.false | ||
92 | expect(data.broadcastMessage.level).to.equal('info') | ||
93 | expect(data.broadcastMessage.message).to.equal('') | ||
94 | expect(data.broadcastMessage.dismissable).to.be.false | ||
90 | } | 95 | } |
91 | 96 | ||
92 | function checkUpdatedConfig (data: CustomConfig) { | 97 | function checkUpdatedConfig (data: CustomConfig) { |
@@ -155,6 +160,11 @@ function checkUpdatedConfig (data: CustomConfig) { | |||
155 | expect(data.followings.instance.autoFollowBack.enabled).to.be.true | 160 | expect(data.followings.instance.autoFollowBack.enabled).to.be.true |
156 | expect(data.followings.instance.autoFollowIndex.enabled).to.be.true | 161 | expect(data.followings.instance.autoFollowIndex.enabled).to.be.true |
157 | expect(data.followings.instance.autoFollowIndex.indexUrl).to.equal('https://updated.example.com') | 162 | expect(data.followings.instance.autoFollowIndex.indexUrl).to.equal('https://updated.example.com') |
163 | |||
164 | expect(data.broadcastMessage.enabled).to.be.true | ||
165 | expect(data.broadcastMessage.level).to.equal('error') | ||
166 | expect(data.broadcastMessage.message).to.equal('super bad message') | ||
167 | expect(data.broadcastMessage.dismissable).to.be.true | ||
158 | } | 168 | } |
159 | 169 | ||
160 | describe('Test config', function () { | 170 | describe('Test config', function () { |
@@ -324,6 +334,12 @@ describe('Test config', function () { | |||
324 | indexUrl: 'https://updated.example.com' | 334 | indexUrl: 'https://updated.example.com' |
325 | } | 335 | } |
326 | } | 336 | } |
337 | }, | ||
338 | broadcastMessage: { | ||
339 | enabled: true, | ||
340 | level: 'error', | ||
341 | message: 'super bad message', | ||
342 | dismissable: true | ||
327 | } | 343 | } |
328 | } | 344 | } |
329 | await updateCustomConfig(server.url, server.accessToken, newCustomConfig) | 345 | await updateCustomConfig(server.url, server.accessToken, newCustomConfig) |