chore: update string tests organization
import * as string from './string';
describe('Routing Utilities', () => {
+ describe('toHtmlId', () => {
+ it('should replace spaces with -', () => {
+ expect(string.toHtmlId('Hello World')).toBe('hello-world');
+ });
+
+ it('should remove everything but alphanumeric and -', () => {
+ expect(string.toHtmlId('He$)%*#$%llo World)#$(%)')).toBe('hello-world');
+ });
+
+ it('should generate lowercase ids', () => {
+ expect(string.toHtmlId('HellO')).toBe('hello');
+ });
+ });
+});
+
describe('capitalizeWord', () => {
it('should make first character uppercase and the rest lower case', () => {
const tests = [
@@ -27,18 +42,3 @@ describe('Routing Utilities', () => {
});
});
});
-
- describe('toHtmlId', () => {
- it('should replace spaces with -', () => {
- expect(string.toHtmlId('Hello World')).toBe('hello-world');
- });
-
- it('should remove everything but alphanumeric and -', () => {
- expect(string.toHtmlId('He$)%*#$%llo World)#$(%)')).toBe('hello-world');
- });
-
- it('should generate lowercase ids', () => {
- expect(string.toHtmlId('HellO')).toBe('hello');
- });
- });
-});
