Skip to content

Commit

Permalink
FLUID-5552: Fixed the unit test failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
cindyli committed Jan 23, 2015
1 parent 29d054b commit e79ab52
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/framework-tests/preferences/js/UIEnhancerTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
});

fluid.tests.testCustomizedEnactors = function (container, cssClass, expectedValue) {
jqUnit.assertEquals("The emphasized links are applied - " + expectedValue, expectedValue, $(container).children("a").hasClass(cssClass));
var index = $(container).prop("class").indexOf(cssClass);
var assertFunc = expectedValue ? jqUnit.assertNotEquals : jqUnit.assertEquals;
assertFunc("The emphasized links css selector has " + expectedValue ? "" : "not " + "been applied - " + expectedValue, -1, index);
};

fluid.defaults("fluid.tests.customizedEnactorsTester", {
Expand Down Expand Up @@ -120,10 +122,9 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
tester.options.testOpts.initialFontSize = parseFloat(container.css("fontSize"));
};

fluid.tests.testTocStyling = function () {
fluid.tests.testToc = function () {
var tocLinks = $(".flc-toc-tocContainer a");
var filtered = tocLinks.filter(".fl-link-enhanced");
jqUnit.assertEquals("All toc links have been styled", tocLinks.length, filtered.length);
jqUnit.assertNotEquals("Toc links have been rendered", 0, tocLinks.length);
jqUnit.assertNotEquals("Some toc links generated on 2nd pass", 0, tocLinks.length);
};

Expand Down Expand Up @@ -159,7 +160,7 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
func: "{uiEnhancer}.updateModel",
args: ["{that}.options.testOpts.testSettings"]
}, {
listener: "fluid.tests.testTocStyling",
listener: "fluid.tests.testToc",
spec: {priority: "last"},
event: "{uiEnhancer}.tableOfContents.events.afterTocRender"
}, {
Expand Down

0 comments on commit e79ab52

Please sign in to comment.