feat: Full rework of account management

Complete rewrite of the account management and related systems.
Makes the architecture more modular,
allowing for easier extensions and configurations.
This commit is contained in:
Joachim Van Herwegen
2022-03-16 10:12:13 +01:00
parent ade977bb4f
commit a47f5236ef
366 changed files with 12345 additions and 5111 deletions

View File

@@ -1,7 +1,9 @@
import {
sanitizeUrlPart,
splitCommaSeparated,
isValidFileName, msToDuration,
isValidFileName,
isUrl,
msToDuration,
} from '../../../src/util/StringUtil';
describe('HeaderUtil', (): void => {
@@ -32,6 +34,17 @@ describe('HeaderUtil', (): void => {
});
});
describe('#isURL', (): void => {
it('returns true if the provided string is a valid URL.', (): void => {
expect(isUrl('http://localhost/foo')).toBe(true);
expect(isUrl('http://foo.localhost:3000/foo')).toBe(true);
expect(isUrl('http://example.com/foo')).toBe(true);
});
it('returns false if the provided string is not a valid URL.', (): void => {
expect(isUrl('not valid')).toBe(false);
});
});
describe('#msToDuration', (): void => {
it('converts ms to a duration string.', async(): Promise<void> => {
const ms = ((2 * 24 * 60 * 60) + (10 * 60 * 60) + (5 * 60) + 50.25) * 1000;