feat: Add the ability add new portal (#5219)
This commit is contained in:
@@ -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, '-');
|
||||
};
|
||||
|
||||
@@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user