Skip to content

Commit

Permalink
Merge remote-tracking branch 'acheetham/FLUID-4806'
Browse files Browse the repository at this point in the history
* acheetham/FLUID-4806:
  FLUID-4806: Fix inappropriate use of $.prop()
  • Loading branch information
michelled committed Oct 19, 2012
2 parents 32cb323 + 976a3a1 commit 6de0638
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion js/ToggleButton.js
Expand Up @@ -78,7 +78,7 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
button.toggleClass(styles.init, !pressed);
button.toggleClass(styles.pressed, pressed);
}
button.prop("aria-pressed", pressed);
button.attr("aria-pressed", pressed);

that.tooltip.updateContent(that.tooltipContentFunction(that));
};
Expand Down
6 changes: 3 additions & 3 deletions tests/js/TestUtils.js
Expand Up @@ -32,7 +32,7 @@ fluid.registerNamespace("fluid.testUtils");
jqUnit.expect(12);
jqUnit.assertEquals("There should be exactly one " + name + " button", 1, buttonEl.length);
jqUnit.assertEquals(name + " button should have role of 'button'", "button", buttonEl.attr("role"));
jqUnit.assertEquals(name + " button should have aria-pressed of 'false' initially", false, buttonEl.prop("aria-pressed"));
jqUnit.assertEquals(name + " button should have aria-pressed of 'false' initially", "false", buttonEl.attr("aria-pressed"));
jqUnit.assertFalse(name + " button should not have the 'pressed' style", buttonEl.hasClass(stylePressed));

var tooltip = fluid.testUtils.getTooltipCheckString(buttonEl, tooltipReleased);
Expand All @@ -41,13 +41,13 @@ fluid.registerNamespace("fluid.testUtils");
jqUnit.assertFalse("After mouseover, " + name + " button should still not have the 'pressed' style", buttonEl.hasClass(stylePressed));

buttonEl.click();
jqUnit.assertEquals("After click, " + name + " button should have aria-pressed of 'true'", true, buttonEl.prop("aria-pressed"));
jqUnit.assertEquals("After click, " + name + " button should have aria-pressed of 'true'", "true", buttonEl.attr("aria-pressed"));
jqUnit.assertTrue("While pressed, " + name + " button should have the 'pressed' style", buttonEl.hasClass(stylePressed));
buttonEl.blur().focus(); // tooltip not updated until 'requested' again
jqUnit.assertEquals("Tooltip should contain " + tooltipPressed, tooltipPressed, tooltip.text());

buttonEl.click();
jqUnit.assertEquals("After another click, " + name + " button should have aria-pressed of 'false' again", false, buttonEl.prop("aria-pressed"));
jqUnit.assertEquals("After another click, " + name + " button should have aria-pressed of 'false' again", "false", buttonEl.attr("aria-pressed"));
jqUnit.assertFalse(name + " button should not have the 'pressed' style", buttonEl.hasClass(stylePressed));
buttonEl.blur().focus();
jqUnit.assertEquals("Tooltip should contain " + tooltipReleased + " again", tooltipReleased, tooltip.text());
Expand Down

0 comments on commit 6de0638

Please sign in to comment.