mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
15 lines
610 B
TypeScript
15 lines
610 B
TypeScript
import { SubdomainIdentifierGenerator } from '../../../../src/pods/generate/SubdomainIdentifierGenerator';
|
|
|
|
describe('A SubdomainIdentifierGenerator', (): void => {
|
|
const base = 'http://test.com/';
|
|
const generator = new SubdomainIdentifierGenerator(base);
|
|
|
|
it('generates identifiers by using the slug as subdomain.', async(): Promise<void> => {
|
|
expect(generator.generate('slug')).toEqual({ path: 'http://slug.test.com/' });
|
|
});
|
|
|
|
it('converts slugs using punycode.', async(): Promise<void> => {
|
|
expect(generator.generate('sàl/u㋡g')).toEqual({ path: 'http://s-l-u-g.test.com/' });
|
|
});
|
|
});
|