Skip to content

Commit

Permalink
fix(components/datetime): ignore extraneous properties when setting c…
Browse files Browse the repository at this point in the history
…alculator value (#2459)
  • Loading branch information
Blackbaud-SteveBrush committed Jul 10, 2024
1 parent edeb684 commit ace058d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,15 @@ describe('Date range picker', function () {
);
}));

it('should ignore extraneous properties when setting the value', () => {
component.dateRange?.setValue({
foo: 'bar',
calculatorId: SkyDateRangeCalculatorId.LastWeek,
});

expect(() => fixture.detectChanges()).not.toThrow();
});

describe('accessibility', () => {
function verifyFormFieldsRequired(expectation: boolean): void {
const inputBoxes =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ export class SkyDateRangePickerComponent
}

if (options?.emitEvent) {
this.formGroup.setValue(valueOrDefault);
this.formGroup.patchValue(valueOrDefault);
}
}
}
Expand Down

0 comments on commit ace058d

Please sign in to comment.