Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Bug fixes:
* [OLMIS-8191](https://openlmis.atlassian.net/browse/OLMIS-8191): Remarks column editable and size adjustable dynamically.
>>>>>>> master
* [OLMIS-8154](https://openlmis.atlassian.net/browse/OLMIS-8154): Explanation no longer required when requested equals calculated.
* [OLMIS-8127](https://openlmis.atlassian.net/browse/OLMIS-8127): Batch approve now shows validation error immediately when field is cleared and loses focus.

7.0.16 / 2026-02-05
=================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
}

ngModelCtrl.$viewChangeListeners.push(validateRequisition);
element.on('blur', validateRequisition);

wrapper.on('openlmisInvalid.show', updateMessage);
wrapper.on('openlmisInvalid.hide', updateMessage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,38 @@ describe('validateRequisition directive', function() {

});

describe('on blur (OLMIS-8127)', function() {

it('should mark requisition invalid when blank field loses focus', function() {
div.find('div:nth-child(1) input').val('');
div.find('div:nth-child(1) input').triggerHandler('change');
$scope.$apply();

div.find('div:nth-child(1) input').triggerHandler('blur');

div.find('div:nth-child(1) input')
.parent()
.trigger('openlmisInvalid.show');

expect($scope.requisition.$error).not.toBeUndefined();
});

it('should not mark requisition invalid on blur when field is filled', function() {
div.find('div:nth-child(1) input').val(5);
div.find('div:nth-child(1) input').triggerHandler('change');
$scope.$apply();

div.find('div:nth-child(1) input').triggerHandler('blur');

div.find('div:nth-child(1) input')
.parent()
.trigger('openlmisInvalid.show');

expect($scope.requisition.$error).toBeUndefined();
});

});

function compileMarkup(markup) {
var element = $compile(markup)($scope);

Expand Down
Loading