Skip to content

Commit 3340f0f

Browse files
committed
Added Tests
Added tests per Ben's comments about using and testing the Validate() api call.
1 parent 3e8231b commit 3340f0f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,12 @@ QUnit.test('AltField and AltFormat tests', function( assert ) {
649649

650650
assert.equal(field.val(), '', 'The main field was cleared by passing null to the SelectedMonth option.');
651651
assert.equal($(SecondaryAltField).val(), '', "The secondary field was cleared by passing null to the SelectedMonth option..");
652+
653+
var selectedVal = field.MonthPicker('Validate');
654+
655+
assert.equal($('#MonthPicker_Validation_MainAltField').css('display'), 'inline', 'A Validate API call showed a validation message about a bad date on #MainAltField.');
656+
657+
assert.equal(selectedVal, null, 'Validate API call returned null when there was no date selected as expected.');
652658

653659
assert.equal(field.MonthPicker('GetSelectedMonthYear'), null, 'GetSelectedMonthYear API call returned null when there was no date selected as expected.');
654660

0 commit comments

Comments
 (0)