Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Selectmenu: fixed unit tests due to initial refresh method changes

  • Loading branch information...
commit d83e169424adf341afea4351cbe5b056f42ac996 1 parent c5d9dbc
Felix Nagel authored January 22, 2012
1  tests/unit/selectmenu/selectmenu_core.js
@@ -53,6 +53,7 @@ $.each([
53 53
 		
54 54
 		equals( button.text(), selected.text(), "inital button text" );		
55 55
 		
  56
+		link.simulate( "focus" );			
56 57
 		link.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );			
57 58
 		equals( element.find("option:selected").val(), selected.next("option").val() , "after keydown original select state" );	
58 59
 		equals( button.text(), selected.next("option").text(), "after keydown button text" );
24  tests/unit/selectmenu/selectmenu_events.js
@@ -22,9 +22,11 @@ test("change", function () {
22 22
 	var widget = this.element.selectmenu("widget"),
23 23
 		menu = widget.filter(".ui-selectmenu-menu"),
24 24
 		button = widget.filter(".ui-selectmenu-button"),
  25
+		link = button.find("a"),
25 26
 		value = this.element.find("option").first().text();
26  
-
27  
-	button.find("a").simulate( "click" );
  27
+		
  28
+	link.simulate( "focus" );
  29
+	link.simulate( "click" );
28 30
 	menu.find("a").first().simulate( "mouseover" ).simulate( "click" );
29 31
 });
30 32
 
@@ -40,6 +42,11 @@ test("close", function () {
40 42
 		}
41 43
 	});
42 44
 
  45
+	var widget = this.element.selectmenu("widget"),
  46
+		button = widget.filter(".ui-selectmenu-button"),
  47
+		link = button.find("a");
  48
+		
  49
+	link.simulate( "focus" );
43 50
 	this.element.selectmenu("open").selectmenu("close");
44 51
 });
45 52
 
@@ -63,9 +70,11 @@ test("focus", function () {
63 70
 
64 71
 	var widget = this.element.selectmenu("widget"),
65 72
 		button = widget.filter(".ui-selectmenu-button"),
  73
+		link = button.find("a"),
66 74
 		menu = widget.filter(".ui-selectmenu-menu");
67 75
 
68  
-	button.find("a").simulate( "click" );
  76
+	link.simulate( "focus" );
  77
+	link.simulate( "click" );
69 78
 	menu.find(".ui-menu-item").simulate("mouseover");
70 79
 });
71 80
 
@@ -81,6 +90,11 @@ test("open", function () {
81 90
 		}
82 91
 	});
83 92
 
  93
+	var widget = this.element.selectmenu("widget"),
  94
+		button = widget.filter(".ui-selectmenu-button"),
  95
+		link = button.find("a");
  96
+		
  97
+	link.simulate( "focus" );
84 98
 	this.element.selectmenu("open");
85 99
 });
86 100
 
@@ -99,9 +113,11 @@ test("select", function () {
99 113
 
100 114
 	var widget = this.element.selectmenu("widget"),
101 115
 		button = widget.filter(".ui-selectmenu-button"),
  116
+		link = button.find("a"),
102 117
 		menu = widget.filter(".ui-selectmenu-menu");
103 118
 
104  
-	button.find("a").simulate( "click" );
  119
+	link.simulate( "focus" );
  120
+	link.simulate( "click" );
105 121
 	menu.find("a").first().simulate( "mouseover" ).simulate("click");
106 122
 });
107 123
 
1  tests/unit/selectmenu/selectmenu_options.js
@@ -23,6 +23,7 @@ test("dropdown: CSS styles", function () {
23 23
 		menu = widget.filter(".ui-selectmenu-menu"),
24 24
 		ul = widget.find("ul");
25 25
 
  26
+	link.simulate( "focus" );
26 27
 	this.element.selectmenu("open");	
27 28
 	ok( link.hasClass("ui-corner-top") && !link.hasClass("ui-corner-all"), "button styles dropdown");		
28 29
 	ok( ul.hasClass("ui-corner-bottom") && !ul.hasClass("ui-corner-all"), "menu styles dropdown");		

0 notes on commit d83e169

Please sign in to comment.
Something went wrong with that request. Please try again.