UNPKG

siesta-lite

Version:

Stress-free JavaScript unit testing and functional testing tool, works in NodeJS and browsers

56 lines (49 loc) 2.22 kB
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>The source code</title> <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="../resources/prettify/prettify.js"></script> <style type="text/css"> .highlight { display: block; background-color: #ddd; } </style> <script type="text/javascript"> function highlight() { document.getElementById(location.hash.replace(/#/, "")).className = "highlight"; } </script> </head> <body onload="prettyPrint(); highlight();"> <pre class="prettyprint lang-js">/* Siesta 5.6.1 Copyright(c) 2009-2022 Bryntum AB https://bryntum.com/contact https://bryntum.com/products/siesta/license */ <span id='Siesta-Test-ExtJS-Element'>/** </span>@class Siesta.Test.ExtJS.Element This is a mixin, with helper methods for testing functionality relating to ExtJS/DOM elements. This mixin is consumed by {@link Siesta.Test.ExtJS} */ Role(&#39;Siesta.Test.ExtJS.Element&#39;, { methods : { <span id='Siesta-Test-ExtJS-Element-method-hasRegion'> /** </span> * Passes if the passed element has the expected region. * * @param {Ext.Element} el The element * @param {Ext.util.Region} region The region to compare to. * @param {String} [description] The description of the assertion */ hasRegion : function(el, region, description) { var elRegion = el.getRegion(); var R = Siesta.Resource(&#39;Siesta.Test.ExtJS.Element&#39;); this.is(elRegion[&quot;top&quot;], region[&quot;top&quot;], description + &#39; &#39; + R.get(&#39;top&#39;) + &#39;)&#39;); this.is(elRegion[&quot;right&quot;], region[&quot;right&quot;], description + &#39; &#39; + R.get(&#39;right&#39;) + &#39;)&#39;); this.is(elRegion[&quot;bottom&quot;], region[&quot;bottom&quot;], description + &#39; &#39; + R.get(&#39;bottom&#39;) + &#39;)&#39;); this.is(elRegion[&quot;left&quot;], region[&quot;left&quot;], description + &#39; &#39; + R.get(&#39;left&#39;) + &#39;)&#39;); } } }); </pre> </body> </html>