Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix #276 icon button test case

  • Loading branch information...
commit 56a2848d1e760f01c116803de6d8f04114b00a92 1 parent 3e7dfe4
@Gprasad Gprasad authored piuccio committed
Showing with 7 additions and 12 deletions.
  1. +7 −12 test/aria/widgets/action/iconbutton/issue276/IconButtonTestCase.js
View
19 test/aria/widgets/action/iconbutton/issue276/IconButtonTestCase.js
@@ -12,20 +12,15 @@ Aria.classDefinition({
$prototype : {
runTemplateTest : function () {
- var iconBtnId = this.getWidgetInstance("myid")._domId;
- var domUtil = aria.utils.Dom;
- // for getting iconbutton image style
- var iconBtnElement = domUtil.getDomElementsChildByTagName(domUtil.getElementById(iconBtnId), 'span')[4];
- var width = domUtil.getStyle(iconBtnElement, "width");
- var height = domUtil.getStyle(iconBtnElement, "height");
+ var iconInfo = this.getWidgetInstance("myid")._icon._iconInfo;
+ var width = iconInfo.width;
+ var height = iconInfo.height;
+ var imageURL = iconInfo.imageURL;
// Background url is different for different browsers, so just checking image name
- var imageURL = domUtil.getStyle(iconBtnElement, "background").split(' ')[0].replace(/("|')/g, "");
- var imagename = imageURL.substring(imageURL.lastIndexOf('/') + 1, imageURL.lastIndexOf(')'));;
-
- this.assertEquals(width, "42px", "Width is not proper");
- this.assertEquals(height, "16px", "Height is not proper");
+ var imagename = imageURL.substring(imageURL.lastIndexOf('/') + 1);
+ this.assertEquals(width, 42, "Width is not proper");
+ this.assertEquals(height, 16, "Height is not proper");
this.assertEquals(imagename, "icon-check.png", "Image is not proper");
-
this.end();
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.