siesta-lite
Version:
Stress-free JavaScript unit testing and functional testing tool, works in NodeJS and browsers
56 lines (49 loc) • 2.22 kB
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('Siesta.Test.ExtJS.Element', {
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('Siesta.Test.ExtJS.Element');
this.is(elRegion["top"], region["top"], description + ' ' + R.get('top') + ')');
this.is(elRegion["right"], region["right"], description + ' ' + R.get('right') + ')');
this.is(elRegion["bottom"], region["bottom"], description + ' ' + R.get('bottom') + ')');
this.is(elRegion["left"], region["left"], description + ' ' + R.get('left') + ')');
}
}
});
</pre>
</body>
</html>