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

test(input): fix date type tests with max + timezone #16526

Merged
merged 1 commit into from
Apr 10, 2018
Merged
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
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