|
moon_test(
name => 'nav_item' ,
build => {
class => 'Moonshine::Bootstrap::Component::NavItem' ,
},
instructions => [
{
test => 'obj' ,
func => 'nav_item' ,
args => {
data => 'URL' ,
},
expected => 'Moonshine::Element' ,
subtest => [
{
test => 'render' ,
expected => '<li role="presentation"><a href="http://some.url">URL</a></li>' }
],
},
{
test => 'obj' ,
func => 'nav_item' ,
args => {
data => 'URL' ,
disable => 1,
dropdown => {
aria_labelledby => 'dropdownMenu1' ,
children => [
{
action => 'linked_li' ,
data => 'URL' ,
},
{
action => 'linked_li' ,
data => 'Second' ,
}
],
},
},
expected => 'Moonshine::Element' ,
subtest => [
{
test => 'render' ,
expected => '<li class="disabled" role="presentation"><a class="dropdown-toggle" href="http://some.url" aria-expanded="false" aria-haspopup="true" role="button" data-toggle="dropdown">URL</a><ul class="dropdown-menu" aria-labelledby="dropdownMenu1"><li><a href="http://some.url">URL</a></li><li><a href="http://second.url">Second</a></li></ul></li>' , }
],
},
],
);
moon_test(
name => 'nav_item' ,
build => {
class => 'Moonshine::Bootstrap::v3::NavItem' ,
},
instructions => [
{
test => 'obj' ,
func => 'nav_item' ,
args => {
data => 'URL' ,
},
expected => 'Moonshine::Element' ,
subtest => [
{
test => 'render' ,
expected => '<li role="presentation"><a href="http://some.url">URL</a></li>' }
],
},
{
test => 'obj' ,
func => 'nav_item' ,
args => {
data => 'URL' ,
disable => 1,
dropdown => {
aria_labelledby => 'dropdownMenu1' ,
children => [
{
action => 'linked_li' ,
data => 'URL' ,
},
{
action => 'linked_li' ,
data => 'Second' ,
}
],
},
},
expected => 'Moonshine::Element' ,
subtest => [
{
test => 'render' ,
expected => '<li class="disabled" role="presentation"><a class="dropdown-toggle" href="http://some.url" aria-expanded="false" aria-haspopup="true" role="button" data-toggle="dropdown">URL</a><ul class="dropdown-menu" aria-labelledby="dropdownMenu1"><li><a href="http://some.url">URL</a></li><li><a href="http://second.url">Second</a></li></ul></li>' , }
],
},
],
);
sunrise();
1;
|