Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

DataManager:SessionLocal - Add test to check that session stored data…

… is loaded if a store is created matching that data
  • Loading branch information...
commit 21b2dc9b2c8f6d29be4ae5ec0b73a4793c860dba 1 parent 61d3b49
@kborchers kborchers authored
Showing with 14 additions and 1 deletion.
  1. +14 −1 tests/unit/data-manager/data-manager-sessionLocal.js
View
15 tests/unit/data-manager/data-manager-sessionLocal.js
@@ -128,7 +128,8 @@ test( "add and remove - object ", function() {
module( "DataManager: SessionLocal - Data Manipulation" );
// Create a session based dataManager to store data for some tests
-var userStore = AeroGear.DataManager({
+var userStoreReload,
+ userStore = AeroGear.DataManager({
name: "users",
type: "SessionLocal"
}).stores.users;
@@ -177,6 +178,18 @@ test( "save - initialize", function() {
]);
equal( userStore.read().length, 6, "Initial data added to store" );
+
+ userStoreReload = AeroGear.DataManager({
+ name: "users",
+ type: "SessionLocal"
+ }).stores.users;
+});
+
+// Check data was loaded from existing session store
+test( "load session stored data", function() {
+ expect( 1 );
+
+ equal( userStoreReload.read().length, 6, "Previously stored data added to store" );
});
// Read data
Please sign in to comment.
Something went wrong with that request. Please try again.