Changeset 1724:4cc223c99439 for tests/functional/spec/toggle_with_legend.js
- Timestamp:
- 09/04/13 21:55:21 (12 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/functional/spec/toggle_with_legend.js
r1703 r1724 1 1 describe("toggleWithLegend method (admin/js/common.js)", function() { 2 3 loadFixtures('menu.html');4 $('#post_status').parent().toggleWithLegend($('#post_status'),{ });2 it("Click arrow must make target visible", function() { 3 loadFixtures('menu.html'); 4 $('#post_status').parent().toggleWithLegend($('#post_status'),{ }); 5 5 6 var $arrow = $('#post_status').parent().find('img');7 $arrow.click();8 expect($('#post_status')).toBeVisible();9 10 11 loadFixtures('menu.html');12 $('#post_status').parent().toggleWithLegend($('#post_status'),{ });6 var $arrow = $('#post_status').parent().find('img'); 7 $arrow.click(); 8 expect($('#post_status')).toBeVisible(); 9 }); 10 it("Click arrow twice,must make target visible and after second click hidden", function() { 11 loadFixtures('menu.html'); 12 $('#post_status').parent().toggleWithLegend($('#post_status'),{ }); 13 13 14 var $arrow = $('#post_status').parent().find('img');15 $arrow.click();16 expect($('#post_status')).toBeVisible();14 var $arrow = $('#post_status').parent().find('img'); 15 $arrow.click(); 16 expect($('#post_status')).toBeVisible(); 17 17 18 $arrow.click();19 expect($('#post_status')).toBeHidden();20 21 22 loadFixtures('menu.html');23 $('#post_status').parent().toggleWithLegend($('#post_status'),{ });18 $arrow.click(); 19 expect($('#post_status')).toBeHidden(); 20 }); 21 it("Chick target must not hide target", function() { 22 loadFixtures('menu.html'); 23 $('#post_status').parent().toggleWithLegend($('#post_status'),{ }); 24 24 25 var $arrow = $('#post_status').parent().find('img');26 $arrow.click();27 expect($('#post_status')).toBeVisible();25 var $arrow = $('#post_status').parent().find('img'); 26 $arrow.click(); 27 expect($('#post_status')).toBeVisible(); 28 28 29 $('#post_status option[value="-2"]').attr('selected', 'selected');30 expect($('#post_status')).toBeVisible();31 32 33 loadFixtures('menu.html');34 var $label = $('#post_status').parent().children('label');35 $label.toggleWithLegend($('#post_status'),{'legend_click':true, a_container:false});29 $('#post_status option[value="-2"]').attr('selected', 'selected'); 30 expect($('#post_status')).toBeVisible(); 31 }); 32 it("Chick target must not hide target, when legend_click is true", function() { 33 loadFixtures('menu.html'); 34 var $label = $('#post_status').parent().children('label'); 35 $label.toggleWithLegend($('#post_status'),{'legend_click':true, a_container:false}); 36 36 37 $label.click();38 expect($('#post_status')).toBeVisible();37 $label.click(); 38 expect($('#post_status')).toBeVisible(); 39 39 40 var $arrow = $('#post_status').parent().find('img');41 $arrow.click();42 expect($('#post_status')).toBeVisible();40 var $arrow = $('#post_status').parent().find('img'); 41 $arrow.click(); 42 expect($('#post_status')).toBeVisible(); 43 43 44 $('#post_status').val(-2).trigger('change');45 expect($('#post_status')).toBeVisible();46 44 $('#post_status').val(-2).trigger('change'); 45 expect($('#post_status')).toBeVisible(); 46 }); 47 47 });
Note: See TracChangeset
for help on using the changeset viewer.