Skip to content

Instantly share code, notes, and snippets.

@jacobandresen
Created April 12, 2011 23:06
Show Gist options
  • Save jacobandresen/916641 to your computer and use it in GitHub Desktop.
Save jacobandresen/916641 to your computer and use it in GitHub Desktop.
ExtJS 4 Jasmine BDD
var reviewGrid = Ext.create("ReviewGrid", {renderTo: 'review'});
var productStore = Ext.create("ProductStore", {});
var productForm = Ext.create("ProductForm", {store:productStore, renderTo: 'product', reviewGrid: reviewGrid});
describe("ProductForm", function() {
it("should be able to navigate 1 product forward ", function() {
waitsFor(5000, function () {
return ( productStore.isLoading() == false);
}, "productStore load");
runs(function() {
var originalProductIdentifier = parseInt(productForm.child("#productid").getValue(), 10);
productForm.query("#productNextButton")[0].handler();
waitsFor(5000, function () {
return ( productStore.isLoading() == false);
}, "productStore load");
runs(function() {
var nextProductIdentifier = parseInt(productForm.child("#productid").getValue(), 10);
expect(nextProductIdentifier).toEqual(parseInt(originalProductIdentifier,10) + 1);
});
});
});
it("should be able to navigate 1 product backwards", function(){
expect(false).toEqual(true);
});
it("should not navigate below 0", function () {
expect(false).toEqual(true);
});
it("should not navigate above the current length", function() {
expect(false).toEqual(true);
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment