feat: Add the ability add new portal (#5219)

This commit is contained in:
Muhsin Keloth
2022-08-10 09:27:52 +05:30
committed by GitHub
parent 657bd44418
commit 16ad263a3a
8 changed files with 278 additions and 8 deletions

View File

@@ -75,3 +75,10 @@ export const convertToCategorySlug = text => {
.replace(/[^\w ]+/g, '')
.replace(/ +/g, '-');
};
export const convertToPortalSlug = text => {
return text
.toLowerCase()
.replace(/[^\w ]+/g, '')
.replace(/ +/g, '-');
};

View File

@@ -3,6 +3,7 @@ import {
createPendingMessage,
convertToAttributeSlug,
convertToCategorySlug,
convertToPortalSlug,
} from '../commons';
describe('#getTypingUsersText', () => {
@@ -104,3 +105,9 @@ describe('convertToCategorySlug', () => {
);
});
});
describe('convertToPortalSlug', () => {
it('should convert to slug', () => {
expect(convertToPortalSlug('Room rental')).toBe('room-rental');
});
});