feat: Adds the ability to edit and delete custom attributes (#2982)
* feat: Adds the ability to edit and delete custom attributes * Review fixes * Minor fixes * Adds specs * Minor fixes * Update settings.routes.js Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
@@ -61,3 +61,10 @@ export const createPendingMessage = data => {
|
||||
|
||||
return pendingMessage;
|
||||
};
|
||||
|
||||
export const convertToSlug = text => {
|
||||
return text
|
||||
.toLowerCase()
|
||||
.replace(/[^\w ]+/g, '')
|
||||
.replace(/ +/g, '_');
|
||||
};
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import { getTypingUsersText, createPendingMessage } from '../commons';
|
||||
import {
|
||||
getTypingUsersText,
|
||||
createPendingMessage,
|
||||
convertToSlug,
|
||||
} from '../commons';
|
||||
|
||||
describe('#getTypingUsersText', () => {
|
||||
it('returns the correct text is there is only one typing user', () => {
|
||||
@@ -83,3 +87,9 @@ describe('#createPendingMessage', () => {
|
||||
expect(pending.attachments.length).toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('convertToSlug', () => {
|
||||
it('should convert to slug', () => {
|
||||
expect(convertToSlug('Test@%^&*(){}>.!@`~_ ing')).toBe('test__ing');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user