From d2683683aed81d1973540399515b9da93ca0a6ae Mon Sep 17 00:00:00 2001 From: Jorge Padawan Date: Fri, 29 Jan 2021 16:15:03 +0100 Subject: [PATCH] Show list of mutiple emails on summary --- front/salix/components/summary/index.spec.js | 30 ++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 front/salix/components/summary/index.spec.js diff --git a/front/salix/components/summary/index.spec.js b/front/salix/components/summary/index.spec.js new file mode 100644 index 000000000..8b5ec0de3 --- /dev/null +++ b/front/salix/components/summary/index.spec.js @@ -0,0 +1,30 @@ +import './index.js'; + +describe('Salix', () => { + describe('Component vnSummary', () => { + let controller; + + beforeEach(ngModule('salix')); + + beforeEach(inject($componentController => { + const $element = angular.element(''); + 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); + }); + }); + }); +});