Created
April 12, 2011 23:06
-
-
Save jacobandresen/916641 to your computer and use it in GitHub Desktop.
ExtJS 4 Jasmine BDD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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