Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 2617-add_scope_days_on_travel_index
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
commit
6fed5a21b7
|
@ -2,7 +2,13 @@ import ngModule from '../../module';
|
||||||
import Section from '../section';
|
import Section from '../section';
|
||||||
import './style.scss';
|
import './style.scss';
|
||||||
|
|
||||||
export default class Summary extends Section {}
|
export default class Summary extends Section {
|
||||||
|
listEmails(email) {
|
||||||
|
if (!email) return;
|
||||||
|
const emailList = email.split(',');
|
||||||
|
return emailList.join(', ');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ngModule.vnComponent('vnSummary', {
|
ngModule.vnComponent('vnSummary', {
|
||||||
controller: Summary
|
controller: Summary
|
||||||
|
|
|
@ -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);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -40,7 +40,7 @@
|
||||||
value="{{$ctrl.summary.mobile}}">
|
value="{{$ctrl.summary.mobile}}">
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
<vn-label-value label="Email" no-ellipsize
|
<vn-label-value label="Email" no-ellipsize
|
||||||
value="{{$ctrl.summary.email}}">
|
value="{{$ctrl.listEmails($ctrl.summary.email)}}">
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
<vn-label-value label="Sales person">
|
<vn-label-value label="Sales person">
|
||||||
<span
|
<span
|
||||||
|
|
Loading…
Reference in New Issue