UNPKG

siesta-lite

Version:

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

49 lines (33 loc) 1.58 kB
/* Siesta 5.6.1 Copyright(c) 2009-2022 Bryntum AB https://bryntum.com/contact https://bryntum.com/products/siesta/license */ Ext.define('Siesta.Project.Browser.UI.CanFillAssertionsStore', { processNewResult : function (assertionStore, test, result, parentResult) { var data = { id : result.id, result : result, loaded : true, leaf : !(result instanceof Siesta.Result.SubTest), expanded : (result instanceof Siesta.Result.SubTest) && result.test.specType != 'it' }; var alreadyInTheStore = assertionStore.getNodeById(result.id) if (alreadyInTheStore) { alreadyInTheStore.triggerUIUpdate() } else { Ext.suspendLayouts() alreadyInTheStore = (assertionStore.getNodeById(parentResult.id) || assertionStore.getRootNode()).appendChild(data); Ext.resumeLayouts() } if (result.isPassed && !result.isPassed() || result.isWarning) alreadyInTheStore.ensureVisible() alreadyInTheStore.updateFolderStatus() }, // is bubbling and thus triggered for all tests (including sub-tests) processEveryTestEnd : function (assertionStore, test) { var testResultNode = assertionStore.getNodeById(test.getResults().id) // can be missing for "root" tests testResultNode && testResultNode.updateFolderStatus() } })