Chatwoot/app/javascript/dashboard/components/widgets/conversation/helpers/specs/emailHeadHelper.spec.js
Nithin David Thomas 1a4faab381
feat: Creates story for cc bcc input component in reply box (#2763)
* feat: Creates cc bcc input component for reply box

* Adds email inputs for cc and bcc

* Cleans storybook code

* Fixes eslint issues

* Update app/javascript/dashboard/components/widgets/conversation/stories/ReplyEmailHead.stories.js

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>

* Review fixes

* Update app/javascript/dashboard/components/widgets/conversation/stories/ReplyEmailHead.stories.js

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>

* Update app/javascript/dashboard/components/widgets/conversation/stories/ReplyEmailHead.stories.js

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>

* Update app/javascript/dashboard/components/widgets/conversation/stories/ReplyEmailHead.stories.js

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2021-08-11 11:34:47 +05:30

13 lines
513 B
JavaScript

import { validEmailsByComma } from '../emailHeadHelper';
describe('#validEmailsByComma', () => {
it('returns true when empty string is passed', () => {
expect(validEmailsByComma('')).toEqual(true);
});
it('returns true when valid emails separated by comma is passed', () => {
expect(validEmailsByComma('ni@njan.com,po@va.da')).toEqual(true);
});
it('returns false when one of the email passed is invalid', () => {
expect(validEmailsByComma('ni@njan.com,pova.da')).toEqual(false);
});
});