siesta-lite
Version:
Stress-free JavaScript unit testing and functional testing tool, works in NodeJS and browsers
30 lines (20 loc) • 867 B
JavaScript
StartTest(function (outer) {
outer.expectPass(function (t) {
var store1 = outer.getStore({ proxy : new Ext.data.MemoryProxy() });
store1.removeAll();
var store2 = outer.getStore({ proxy : new Ext.data.MemoryProxy() });
store2.proxy.data = [{ Foo : 'bar'}];
t.isStoreEmpty(store1, 'PASS: Store empty');
t.waitForStoresToLoad(store2, function () { });
t.loadStoresAndThen(store2, function () {
t.pass('loadStoresAndThen worked ok');
});
});
outer.expectFail(function (t) {
var store1 = outer.getStore({ proxy : new Ext.data.MemoryProxy() });
store1.proxy.data = [{ Foo : 'bar'}];
store1.load();
t.isStoreEmpty(store1, 'FAIL: Store empty');
t.waitForStoresToLoad(store1, function () { });
}, null, { waitForTimeout : 500 });
});