Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
test(input): fix date type tests with max + timezone
Browse files Browse the repository at this point in the history
Closes #16526
  • Loading branch information
Narretz authored Apr 10, 2018
1 parent f04e04e commit abe6acf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/ng/directive/inputSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,9 @@ describe('input', function() {
});

it('should validate when timezone is provided.', function() {
// We cannot use the default element
dealoc(inputElm);

inputElm = helper.compileInput('<input type="month" ng-model="value" name="alias" ' +
'max="{{ maxVal }}" ng-model-options="{timezone: \'UTC\', allowInvalid: true}"/>');
$rootScope.maxVal = '2013-01';
Expand Down Expand Up @@ -1127,6 +1130,9 @@ describe('input', function() {
});

it('should validate when timezone is provided.', function() {
// We cannot use the default element
dealoc(inputElm);

inputElm = helper.compileInput('<input type="week" ng-model="value" name="alias" ' +
'max="{{ maxVal }}" ng-model-options="{timezone: \'-2400\', allowInvalid: true}"/>');
// The calendar week comparison date is January 17. Setting the timezone to -2400
Expand Down Expand Up @@ -1434,6 +1440,9 @@ describe('input', function() {
});

it('should validate when timezone is provided.', function() {
// We cannot use the default element
dealoc(inputElm);

inputElm = helper.compileInput('<input type="datetime-local" ng-model="value" name="alias" ' +
'max="{{ maxVal }}" ng-model-options="{timezone: \'UTC\', allowInvalid: true}"/>');
$rootScope.maxVal = '2013-01-01T00:00:00';
Expand Down Expand Up @@ -1788,6 +1797,9 @@ describe('input', function() {
});

it('should validate when timezone is provided.', function() {
// We cannot use the default element
dealoc(inputElm);

inputElm = helper.compileInput('<input type="time" ng-model="value" name="alias" ' +
'max="{{ maxVal }}" ng-model-options="{timezone: \'UTC\', allowInvalid: true}"/>');
$rootScope.maxVal = '22:30:00';
Expand Down

0 comments on commit abe6acf

Please sign in to comment.