2162-print_pdf_puppeteer #335
|
@ -7,7 +7,7 @@ describe('Component vnInputNumber', () => {
|
|||
beforeEach(ngModule('vnCore'));
|
||||
|
||||
beforeEach(angular.mock.inject(($compile, $rootScope) => {
|
||||
$element = $compile(`<vn-input-number></vn-input-number>`)($rootScope);
|
||||
$element = $compile(`<vn-input-number ng-model="model" />`)($rootScope);
|
||||
$ctrl = $element.controller('vnInputNumber');
|
||||
}));
|
||||
|
||||
|
@ -20,12 +20,10 @@ describe('Component vnInputNumber', () => {
|
|||
$ctrl.field = -1;
|
||||
$ctrl.min = 0;
|
||||
|
||||
// FIXME: Input validation doesn't work with Jest?
|
||||
// expect($ctrl.shownError).toContain('Please select a value that is no less than 0');
|
||||
expect($ctrl.shownError).toBeNull();
|
||||
expect($ctrl.shownError).toContain('Constraints not satisfied');
|
||||
});
|
||||
|
||||
it(`should unset error property when value is upper than min`, () => {
|
||||
it(`should unset error property when value is greater than min`, () => {
|
||||
$ctrl.field = 1;
|
||||
$ctrl.min = 0;
|
||||
|
||||
|
@ -34,19 +32,16 @@ describe('Component vnInputNumber', () => {
|
|||
});
|
||||
|
||||
describe('max() setter', () => {
|
||||
it(`should set error property when value is upper than max`, () => {
|
||||
it(`should set error property when value is greater than max`, () => {
|
||||
$ctrl.field = 1;
|
||||
$ctrl.max = 0;
|
||||
|
||||
// FIXME: Input validation doesn't work with Jest?
|
||||
// expect($ctrl.shownError).toContain('Please select a value that is no more than 0');
|
||||
expect($ctrl.shownError).toBeNull();
|
||||
expect($ctrl.shownError).toContain('Constraints not satisfied');
|
||||
});
|
||||
|
||||
// FIXME: Input validation doesn't work with Jest?
|
||||
it(`should unset error property when value is lower than max`, () => {
|
||||
$ctrl.field = -1;
|
||||
$ctrl.min = 0;
|
||||
$ctrl.max = 0;
|
||||
|
||||
expect($ctrl.shownError).toBeNull();
|
||||
});
|
||||
|
@ -54,14 +49,12 @@ describe('Component vnInputNumber', () => {
|
|||
|
||||
describe('step() setter', () => {
|
||||
it(`should increase value when add icon is clicked`, () => {
|
||||
$ctrl.step = 1;
|
||||
$ctrl.field = 1;
|
||||
$ctrl.input.step = 1;
|
||||
$ctrl.input.value = 0;
|
||||
|
||||
// FIXME: Doesn't work with Jest?
|
||||
// $ctrl.stepUp();
|
||||
// $element[0].querySelector('vn-icon[icon=add]').click();
|
||||
$ctrl.stepUp();
|
||||
|
||||
expect($ctrl.field).toBe(1);
|
||||
expect($ctrl.input.value).toBe('1');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -94,7 +94,8 @@ ngModule.vnComponent('vnDescriptor', {
|
|||
transclude: {
|
||||
btnOne: '?btnOne',
|
||||
btnTwo: '?btnTwo',
|
||||
btnThree: '?btnThree'
|
||||
btnThree: '?btnThree',
|
||||
btnFour: '?btnFour'
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ vn-descriptor-content {
|
|||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0 $spacing-md;
|
||||
padding: 0 $spacing-sm;
|
||||
margin: 0 $spacing-sm;
|
||||
|
||||
& > vn-icon {
|
||||
|
|
|
@ -146,6 +146,20 @@
|
|||
</vn-quick-link>
|
||||
</div>
|
||||
<div ng-transclude="btnTwo">
|
||||
<vn-quick-link
|
||||
tooltip="Client ticket list"
|
||||
state="['ticket.index', {q: $ctrl.filter}]"
|
||||
icon="icon-ticket">
|
||||
</vn-quick-link>
|
||||
</div>
|
||||
<div ng-transclude="btnThree">
|
||||
<vn-quick-link
|
||||
tooltip="New order"
|
||||
state="['order.create', {clientFk: $ctrl.ticket.clientFk}]"
|
||||
icon="icon-basketadd">
|
||||
</vn-quick-link>
|
||||
</div>
|
||||
<div ng-transclude="btnFour">
|
||||
<vn-quick-link
|
||||
ng-if="$ctrl.ticket.stowaway"
|
||||
tooltip="Ship stowaways"
|
||||
|
@ -153,7 +167,7 @@
|
|||
icon="icon-stowaway">
|
||||
</vn-quick-link>
|
||||
</div>
|
||||
<div ng-transclude="btnThree">
|
||||
<div ng-transclude="btnFour">
|
||||
<vn-quick-link
|
||||
ng-if="$ctrl.ticket.ship"
|
||||
tooltip="Stowaway"
|
||||
|
|
|
@ -38,6 +38,12 @@ class Controller extends Descriptor {
|
|||
return this.ticket.stowaway || this.ticket.ship;
|
||||
}
|
||||
|
||||
get filter() {
|
||||
if (this.ticket)
|
||||
return JSON.stringify({clientFk: this.ticket.clientFk});
|
||||
return null;
|
||||
}
|
||||
|
||||
isTicketEditable() {
|
||||
this.$http.get(`Tickets/${this.$state.params.id}/isEditable`).then(res => {
|
||||
this.isEditable = res.data;
|
||||
|
|
|
@ -11,5 +11,5 @@ clientSignature: Firma del cliente
|
|||
claim: Reclamación {0}
|
||||
sections:
|
||||
agency:
|
||||
description: 'Para agilizar tu recogida, por favor, pónte en contacto con la oficina
|
||||
description: 'Para agilizar su recogida, por favor, póngase en contacto con la oficina
|
||||
de integrados. <br/> Tlf: 96 166 77 88 - Ana Gómez (Ext. 2113) <em>(agomezf@integra2.es)</em>'
|
||||
|
|
Loading…
Reference in New Issue