feat: add password change, class unenroll, and optional notify flags

Let admins skip SMS on user, class, and invoice actions, and let users change their own password with the current one.
This commit is contained in:
2026-08-15 23:48:18 +03:30
parent 0cdb9cec20
commit 192c595c68
16 changed files with 289 additions and 60 deletions
+18
View File
@@ -0,0 +1,18 @@
'use strict';
const { describe, it } = require('node:test');
const assert = require('node:assert/strict');
const { assertPasswordStrength, MIN_PASSWORD_LENGTH } = require('./passwordRules');
describe('assertPasswordStrength', () => {
it(`rejects passwords shorter than ${MIN_PASSWORD_LENGTH} characters`, () => {
assert.throws(() => assertPasswordStrength('ab12'), { errorCode: 'WEAK_PASSWORD' });
assert.throws(() => assertPasswordStrength(''), { errorCode: 'WEAK_PASSWORD' });
assert.throws(() => assertPasswordStrength(null), { errorCode: 'WEAK_PASSWORD' });
});
it('accepts passwords that meet the minimum length', () => {
assert.doesNotThrow(() => assertPasswordStrength('ab1234'));
assert.doesNotThrow(() => assertPasswordStrength('longer-secret'));
});
});