Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

fix #276 custom image Test case Issues #360

Closed
wants to merge 1 commit into from

1 participant

@Gprasad

This commit fixes the custom image icon button test case issue.

@Gprasad Gprasad closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 5, 2013
  1. @Gprasad

    fix #276 icon button test case

    Gprasad authored
This page is out of date. Refresh to see the latest.
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();
}
}
Something went wrong with that request. Please try again.