diff --git a/front/core/components/label-value/label-value.html b/front/core/components/label-value/label-value.html index 714c0f278..138e593c2 100644 --- a/front/core/components/label-value/label-value.html +++ b/front/core/components/label-value/label-value.html @@ -1,6 +1,12 @@
- - + + + + + { + let $element; + let controller; + + beforeEach(angular.mock.module('vnCore', $translateProvider => { + $translateProvider.translations('en', {}); + })); + + beforeEach(angular.mock.inject($componentController => { + const $attrs = {}; + $element = angular.element(`${template}`); + controller = $componentController('vnLabelValue', {$element, $attrs}); + })); + + describe('applyTextContent()', () => { + it(`should set the value on the span element as there's no navigation setted`, () => { + const value = 'I am the value'; + controller.value = value; + controller.title = value; + controller.applyTextContent(); + + expect(controller.element.querySelector('span').textContent).toEqual(value); + expect(controller.element.querySelector('span').title).toEqual(value); + }); + + it(`should set the value on the anchor element as there's a navigation setted`, () => { + const value = 'I am the value'; + controller.value = value; + controller.title = value; + controller.state = 'some.state.to.go'; + controller.applyTextContent(); + + expect(controller.element.querySelector('a').textContent).toEqual(value); + expect(controller.element.querySelector('a').title).toEqual(value); + }); + }); +}); diff --git a/modules/ticket/front/summary/index.html b/modules/ticket/front/summary/index.html index 7105e0515..383d02ec9 100644 --- a/modules/ticket/front/summary/index.html +++ b/modules/ticket/front/summary/index.html @@ -36,7 +36,9 @@ value="{{$ctrl.summary.landed | dateTime: 'dd/MM/yyyy'}}"> + value="{{$ctrl.summary.routeFk}}" + state="route.card.summary" + state-params="{id: $ctrl.summary.routeFk}">