Book Image

Ext JS Essentials

By : Stuart Ashworth , Andrew Duncan
Book Image

Ext JS Essentials

By: Stuart Ashworth , Andrew Duncan

Overview of this book

<p>Ext JS 5 is a heavyweight JavaScript framework used by millions to build rich and interactive web applications. Its numerous widgets and advanced data package make it especially well-suited for enterprise class software. The framework encourages the creation of good architectures and is extremely customizable.</p> <p>Ext JS Essentials is aimed at giving you a fast-track understanding of Ext JS. This book covers the most important aspects of the framework in a concise but comprehensive way, ensuring your success using its many features.</p> <p>Written around an example application, the book is packed with practical insights into how the framework works, architecting your applications, working with data, and the many widgets on offer.</p>
Table of Contents (17 chapters)
Ext JS Essentials
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Writing unit tests


Siesta allows us to create unit test suites which allow us to exercise non-UI logic. We will write some simple tests for our BizDash.config.Config class to test its methods. A slightly cut down version of this class is shown here:

Ext.define('BizDash.config.Config', {
  extend: 'Ext.util.Observable',
  singleton: true,
  config: { version: '0.0.1-0' ... },
  ...
  getBuildNumber: function() {
    var versionSplit = this.getVersion().split('-');
    return versionSplit[1];
  },
  applyVersion: function(newVersion, oldVersion){
    return newVersion;
  },
  updateVersion: function(newVersion, oldVersion){
    if(this.hasListeners) {
      this.fireEvent('versionchanged', newVersion, oldVersion);
    }
  }
});

Testing project structure

We will start by adding the Siesta framework files to our project folder; these can be downloaded from the Siesta website (http://www.bryntum.com/products/siesta/).

Note

Siesta offers a Lite version, which can be used for free but is limited in...