Skip to content

Commit 95419e5

Browse files
author
Volodymyr Zaets
committed
MAGETWO-48535: No js validation for date of birth attribute on storefront
1 parent fe48c28 commit 95419e5

File tree

1 file changed

+19
-0
lines changed
  • app/code/Magento/Customer/Test/Unit/Block/Widget

1 file changed

+19
-0
lines changed

app/code/Magento/Customer/Test/Unit/Block/Widget/DobTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,4 +461,23 @@ public function testGetMaxDateRangeWithException()
461461
);
462462
$this->assertNull($this->_block->getMaxDateRange());
463463
}
464+
465+
public function testGetHtmlExtraParamsWithoutRequiredOption() {
466+
$this->attribute->expects($this->once())
467+
->method("isRequired")
468+
->willReturn(false);
469+
470+
$this->assertEquals($this->_block->getHtmlExtraParams(), 'data-validate="{\'validate-date-au\':true}"');
471+
}
472+
473+
public function testGetHtmlExtraParamsWithRequiredOption() {
474+
$this->attribute->expects($this->once())
475+
->method("isRequired")
476+
->willReturn(true);
477+
478+
$this->assertEquals(
479+
$this->_block->getHtmlExtraParams(),
480+
'data-validate="{\'validate-date-au\':true, required:true}"'
481+
);
482+
}
464483
}

0 commit comments

Comments
 (0)