mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user