| @@ 124-139 (lines=16) @@ | ||
| 121 | } |
|
| 122 | ||
| 123 | /** @test */ |
|
| 124 | public function it_sets_active_items_in_dropdown() |
|
| 125 | { |
|
| 126 | $this->menu->getMenu('test') |
|
| 127 | ->dropdown('slug', 'name', function (DropDown $dropdown) { |
|
| 128 | $dropdown->link('slug2', function () { |
|
| 129 | // |
|
| 130 | }); |
|
| 131 | }); |
|
| 132 | ||
| 133 | $this->menu->setActive('slug2'); |
|
| 134 | ||
| 135 | $menu = $this->menu->render('test'); |
|
| 136 | ||
| 137 | $this->assertTrue($menu->links->first()->active); |
|
| 138 | $this->assertTrue($menu->links->first()->links->first()->active); |
|
| 139 | } |
|
| 140 | ||
| 141 | /** @test */ |
|
| 142 | public function it_sets_active_items_in_dropdown_without_parentage() |
|
| @@ 142-159 (lines=18) @@ | ||
| 139 | } |
|
| 140 | ||
| 141 | /** @test */ |
|
| 142 | public function it_sets_active_items_in_dropdown_without_parentage() |
|
| 143 | { |
|
| 144 | $this->menu->getMenu('test') |
|
| 145 | ->dropdown('slug', 'name', function (DropDown $dropdown) { |
|
| 146 | $dropdown->disableActiveParentage(); |
|
| 147 | ||
| 148 | $dropdown->link('slug2', function () { |
|
| 149 | // |
|
| 150 | }); |
|
| 151 | }); |
|
| 152 | ||
| 153 | $this->menu->setActive('slug2'); |
|
| 154 | ||
| 155 | $menu = $this->menu->render('test'); |
|
| 156 | ||
| 157 | $this->assertFalse($menu->links->first()->active); |
|
| 158 | $this->assertTrue($menu->links->first()->links->first()->active); |
|
| 159 | } |
|
| 160 | ||
| 161 | /** @test */ |
|
| 162 | public function it_tests_insert_before_link() |
|