Verified Commit e45f38a0 authored by Chocobozzz's avatar Chocobozzz
Browse files

Add tests for min signup age config

parent b74e6159
......@@ -158,7 +158,7 @@
<small i18n *ngIf="hasUnlimitedSignup()" class="text-muted">Signup won't be limited to a fixed number of users.</small>
</div>
<div [ngClass]="getDisabledSignupClass()" class="mt-3">
<label i18n for="signupMinimumAge">Minimum required age to create an account</label>
......@@ -483,7 +483,7 @@
<ng-container formGroupName="twitter">
<div class="form-group">
<label i18n>Your Twitter username</label>
<label for="servicesTwitterUsername" i18n>Your Twitter username</label>
<input
type="text" id="servicesTwitterUsername" class="form-control"
......
......@@ -216,6 +216,7 @@ class ServerConfigManager {
const signup = {
allowed,
allowedForCurrentIP,
minimumAge: CONFIG.SIGNUP.MINIMUM_AGE,
requiresEmailVerification: CONFIG.SIGNUP.REQUIRES_EMAIL_VERIFICATION
}
......
......@@ -60,6 +60,7 @@ function checkInitialConfig (server: ServerInfo, data: CustomConfig) {
expect(data.signup.enabled).to.be.true
expect(data.signup.limit).to.equal(4)
expect(data.signup.minimumAge).to.equal(16)
expect(data.signup.requiresEmailVerification).to.be.false
expect(data.admin.email).to.equal('admin' + server.internalServerNumber + '@example.com')
......@@ -151,6 +152,7 @@ function checkUpdatedConfig (data: CustomConfig) {
expect(data.signup.enabled).to.be.false
expect(data.signup.limit).to.equal(5)
expect(data.signup.requiresEmailVerification).to.be.false
expect(data.signup.minimumAge).to.equal(10)
// We override admin email in parallel tests, so skip this exception
if (parallelTests() === false) {
......@@ -317,7 +319,7 @@ describe('Test config', function () {
enabled: false,
limit: 5,
requiresEmailVerification: false,
minimumAge: 16
minimumAge: 10
},
admin: {
email: 'superadmin1@example.com'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment