| [1703] | 1 | describe("toggleWithLegend method (admin/js/common.js)", function() { |
|---|
| [1724] | 2 | it("Click arrow must make target visible", function() { |
|---|
| [2188] | 3 | loadStyleFixtures('default.css'); |
|---|
| [1724] | 4 | loadFixtures('menu.html'); |
|---|
| 5 | $('#post_status').parent().toggleWithLegend($('#post_status'),{ }); |
|---|
| [1602] | 6 | |
|---|
| [1724] | 7 | var $arrow = $('#post_status').parent().find('img'); |
|---|
| 8 | $arrow.click(); |
|---|
| 9 | expect($('#post_status')).toBeVisible(); |
|---|
| 10 | }); |
|---|
| 11 | it("Click arrow twice,must make target visible and after second click hidden", function() { |
|---|
| 12 | loadFixtures('menu.html'); |
|---|
| [2188] | 13 | loadStyleFixtures('default.css'); |
|---|
| [1724] | 14 | $('#post_status').parent().toggleWithLegend($('#post_status'),{ }); |
|---|
| [1602] | 15 | |
|---|
| [1724] | 16 | var $arrow = $('#post_status').parent().find('img'); |
|---|
| 17 | $arrow.click(); |
|---|
| 18 | expect($('#post_status')).toBeVisible(); |
|---|
| [1602] | 19 | |
|---|
| [1724] | 20 | $arrow.click(); |
|---|
| 21 | expect($('#post_status')).toBeHidden(); |
|---|
| 22 | }); |
|---|
| 23 | it("Chick target must not hide target", function() { |
|---|
| 24 | loadFixtures('menu.html'); |
|---|
| [2188] | 25 | loadStyleFixtures('default.css'); |
|---|
| [1724] | 26 | $('#post_status').parent().toggleWithLegend($('#post_status'),{ }); |
|---|
| [1602] | 27 | |
|---|
| [1724] | 28 | var $arrow = $('#post_status').parent().find('img'); |
|---|
| 29 | $arrow.click(); |
|---|
| 30 | expect($('#post_status')).toBeVisible(); |
|---|
| [1602] | 31 | |
|---|
| [1724] | 32 | $('#post_status option[value="-2"]').attr('selected', 'selected'); |
|---|
| 33 | expect($('#post_status')).toBeVisible(); |
|---|
| 34 | }); |
|---|
| 35 | it("Chick target must not hide target, when legend_click is true", function() { |
|---|
| 36 | loadFixtures('menu.html'); |
|---|
| [2188] | 37 | loadStyleFixtures('default.css'); |
|---|
| [1724] | 38 | var $label = $('#post_status').parent().children('label'); |
|---|
| 39 | $label.toggleWithLegend($('#post_status'),{'legend_click':true, a_container:false}); |
|---|
| [1602] | 40 | |
|---|
| [1724] | 41 | $label.click(); |
|---|
| 42 | expect($('#post_status')).toBeVisible(); |
|---|
| [1606] | 43 | |
|---|
| [1724] | 44 | var $arrow = $('#post_status').parent().find('img'); |
|---|
| 45 | $arrow.click(); |
|---|
| 46 | expect($('#post_status')).toBeVisible(); |
|---|
| [1602] | 47 | |
|---|
| [1724] | 48 | $('#post_status').val(-2).trigger('change'); |
|---|
| 49 | expect($('#post_status')).toBeVisible(); |
|---|
| 50 | }); |
|---|
| [1602] | 51 | }); |
|---|