UNPKG

siesta-lite

Version:

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

96 lines (79 loc) 3.57 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 */ Ext.define(&#39;Siesta.Project.Browser.UI.AssertionTreeColumn&#39;, { extend : &#39;Ext.tree.Column&#39;, alias : &#39;widget.assertiontreecolumn&#39;, imgWithOffsetText : &#39;&lt;img src=&quot;{1}&quot; class=&quot;{0}&quot; style=&quot;left:{2}px&quot; /&gt;&#39;, tdCls : &#39;tr-tree-column&#39;, resultTpl : null, dataIndex : &#39;folderStatus&#39;, menuDisabled : true, sortable : false, width : 500, descriptionTpl : &#39;&lt;span class=&quot;assertion-text&quot;&gt;{text}&lt;/span&gt;&#39;, initComponent : function () { this.descriptionTpl = this.descriptionTpl instanceof Ext.XTemplate ? this.descriptionTpl : new Ext.XTemplate(this.descriptionTpl); Ext.apply(this, { scope : this }); this.callParent(arguments); }, renderer : function (value, metaData, record, rowIndex, colIndex, store) { var retVal = &#39;&#39;; var result = record.data.result; var annotation = result.annotation; if (result instanceof Siesta.Result.Summary) { return record.data.result.description.join(&#39;&lt;br&gt;&#39;); } retVal = this.descriptionTpl.apply({ text : Ext.String.htmlEncode(result.isWarning ? &#39;WARN: &#39; + result.description : result.description) }); if (annotation) { retVal += &#39;&lt;pre title=&quot;&#39; + annotation.replace(/&quot;/g, &quot;&#39;&quot;) + &#39;&quot; style=&quot;margin-left:&#39; + record.data.depth * 16 + &#39;px&quot; class=&quot;tr-assert-row-annotation&quot;&gt;&#39; + Ext.String.htmlEncode(annotation).replace(&#39;[code]&#39;, &#39;&lt;code&gt;&#39;).replace(&#39;[/code]&#39;, &#39;&lt;/code&gt;&#39;); + &#39;&lt;/pre&gt;&#39;; } return retVal; }, // HACK OVERRIDE treeRenderer : function (value, metaData, record) { var result = record.getResult() if (result instanceof Siesta.Result.Assertion) { if (result.isWaitFor) record.data.iconCls = result.completed ? &#39;fa-clock-o&#39; : &#39;fa-spinner fa-spin&#39; else if (result.isException) record.data.iconCls = &#39;fa-flag&#39;; else record.data.iconCls = result.passed ? &#39;fa-check&#39; : &#39;fa-bug&#39; } else if (result instanceof Siesta.Result.SubTest) { if( record.get(&#39;folderStatus&#39;) === &#39;working&#39;) { record.data.iconCls = &#39;fa-spinner fa-spin&#39;; } else { record.data.iconCls = &#39;&#39;; } } return this.callParent(arguments); } }); </pre> </body> </html>