X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Fplugins_legend.js;h=9d5df4653b282d63d2f1c3bc4e9a803eff530a13;hb=3123ca57f71d145bb5bcc4a2f754d3dff3225346;hp=3288329fc60c1169be9782559b44847193334d50;hpb=335011fd4473f55aaaceb69726d15e0063373149;p=dygraphs.git diff --git a/auto_tests/tests/plugins_legend.js b/auto_tests/tests/plugins_legend.js index 3288329..9d5df46 100644 --- a/auto_tests/tests/plugins_legend.js +++ b/auto_tests/tests/plugins_legend.js @@ -3,16 +3,16 @@ * * @author akiya.mizukoshi@gmail.com (Akiyah) */ -var pluginsLegendTestCase = TestCase("plugins-legend"); +describe("plugins-legend", function() { -pluginsLegendTestCase.prototype.setUp = function() { +beforeEach(function() { document.body.innerHTML = "
"; -}; +}); -pluginsLegendTestCase.prototype.tearDown = function() { -}; +afterEach(function() { +}); -pluginsLegendTestCase.prototype.testLegendEscape = function() { +it('testLegendEscape', function() { var opts = { width: 480, height: 320 @@ -40,7 +40,9 @@ pluginsLegendTestCase.prototype.testLegendEscape = function() { } legendPlugin.select(e); - var legendSpan = $(legendPlugin.legend_div_).find("span b span"); - assertEquals("<script>alert('XSS')</script>", legendSpan.html()); -}; + var legendSpan = legendPlugin.legend_div_.querySelector("span b span"); + assert.equal(legendSpan.innerHTML, "<script>alert('XSS')</script>"); +}); + +});