Show list of mutiple emails on summary

This commit is contained in:
Jorge Padawan 2021-01-29 16:15:03 +01:00
parent 2b4f4cf8f4
commit d2683683ae
1 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,30 @@
import './index.js';
describe('Salix', () => {
describe('Component vnSummary', () => {
let controller;
beforeEach(ngModule('salix'));
beforeEach(inject($componentController => {
const $element = angular.element('<vn-summary></vn-summary>');
controller = $componentController('vnSummary', {$element});
}));
describe('listEmails()', () => {
it('should do nothing when receives no arguments', () => {
const emailList = controller.listEmails();
expect(emailList).toBeUndefined();
});
it('should format the receives emails to be separated with comma', () => {
const expectedResult = 'captainmarvel@marvel.com, ironman@marvel.com';
const emailList = controller.listEmails('captainmarvel@marvel.com,ironman@marvel.com');
expect(emailList).toEqual(expectedResult);
});
});
});
});