Skip to content

Commit

Permalink
fix(test): fix bh-date-editor tests
Browse files Browse the repository at this point in the history
Cherry picked the bh-date-editor changes from #4837 to bring them into
master sooner.

Closes #4919.
  • Loading branch information
jniles committed Sep 30, 2020
1 parent 2f8790f commit c8dad2b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions client/src/js/components/bhDateEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ angular.module('bhima.components')
dateValue : '<', // one-way binding
onChange : '&',
minDate : '<?',
required : '<?',
maxDate : '<?',
allowFutureDate : '<?',
disabled : '<?',
Expand Down
4 changes: 2 additions & 2 deletions client/src/modules/templates/bhDateEditor.tmpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
ng-class="{ 'has-error' : DateEditorForm.$submitted && DateEditorForm.$invalid } "
data-date-editor>

<label class="control-label" translate>
<label class="control-label" bh-date-editor-label translate>
{{ $ctrl.label }}
</label>

Expand All @@ -34,7 +34,7 @@
data-date-editor-input
ng-readonly="!$ctrl.editMode"
ng-disabled="$ctrl.disabled"
ng-required="required">
ng-required="$ctrl.required">
<span class="input-group-btn">
<button
type="button"
Expand Down
4 changes: 2 additions & 2 deletions test/end-to-end/offdays/offdays.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class OffdayPage {
await FU.buttons.create();
await FU.input('OffdayModalCtrl.offday.label', offday.label);

components.dateEditor.set(new Date(offday.date), null, '[uib-modal] .title');
components.dateEditor.set(new Date(offday.date));

await FU.input('OffdayModalCtrl.offday.percent_pay', offday.percent_pay);

Expand Down Expand Up @@ -50,7 +50,7 @@ class OffdayPage {

await FU.input('OffdayModalCtrl.offday.label', updateOffday.label);

components.dateEditor.set(new Date(updateOffday.date), null, '[uib-modal] .title');
components.dateEditor.set(new Date(updateOffday.date));

await FU.input('OffdayModalCtrl.offday.percent_pay', updateOffday.percent_pay);

Expand Down
2 changes: 1 addition & 1 deletion test/end-to-end/shared/components/bhDateEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
* close the selection component Dates.
*/
set : async function set(date, id, elementClick) {
const elementCloseComponent = elementClick || '.header-image';
const elementCloseComponent = elementClick || '[bh-date-editor-label]';

// fail hard if the user did not pass into
/* if (!(date instanceof Date)) {
Expand Down

0 comments on commit c8dad2b

Please sign in to comment.