Permalink
Browse files

Menu tests: Force line height to ensure we know how many items will b…

…e scrolled.
  • Loading branch information...
1 parent 1096f19 commit 6a74bf992944419caabc7adb8ec8ca758451f1d5 @scottgonzalez scottgonzalez committed Nov 20, 2013
Showing with 10 additions and 6 deletions.
  1. +4 −0 tests/unit/menu/menu.html
  2. +6 −6 tests/unit/menu/menu_events.js
@@ -31,6 +31,10 @@
<style>
.ui-menu {
font-size: 15px;
+ line-height: 15px;
+ }
+ .ui-menu .ui-menu-item {
+ padding: 0;
}
#menu3 {
height: 250px;
@@ -389,15 +389,15 @@ asyncTest( "handle keyboard navigation on menu with scroll and without submenus"
log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
- equal( logOutput(), "keydown,11", "Keydown PAGE_DOWN" );
+ equal( logOutput(), "keydown,17", "Keydown PAGE_DOWN" );
log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
- equal( logOutput(), "keydown,22", "Keydown PAGE_DOWN" );
+ equal( logOutput(), "keydown,34", "Keydown PAGE_DOWN" );
log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
- equal( logOutput(), "keydown,11", "Keydown PAGE_UP" );
+ equal( logOutput(), "keydown,17", "Keydown PAGE_UP" );
log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
@@ -484,15 +484,15 @@ asyncTest( "handle keyboard navigation on menu with scroll and with submenus", f
function menukeyboard3() {
log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
- equal( logOutput(), "keydown,11", "Keydown PAGE_DOWN" );
+ equal( logOutput(), "keydown,17", "Keydown PAGE_DOWN" );
log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
- equal( logOutput(), "keydown,22", "Keydown PAGE_DOWN" );
+ equal( logOutput(), "keydown,27", "Keydown PAGE_DOWN" );
log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
- equal( logOutput(), "keydown,11", "Keydown PAGE_UP" );
+ equal( logOutput(), "keydown,10", "Keydown PAGE_UP" );
log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );

0 comments on commit 6a74bf9

Please sign in to comment.