Diffstat (limited to 'frontend/gamma/tests/tests/Clipperz/PM/DataModel/Record.test.js') (more/less context) (show whitespace changes)
-rw-r--r-- | frontend/gamma/tests/tests/Clipperz/PM/DataModel/Record.test.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/frontend/gamma/tests/tests/Clipperz/PM/DataModel/Record.test.js b/frontend/gamma/tests/tests/Clipperz/PM/DataModel/Record.test.js index 3478743..af1ffe8 100644 --- a/frontend/gamma/tests/tests/Clipperz/PM/DataModel/Record.test.js +++ b/frontend/gamma/tests/tests/Clipperz/PM/DataModel/Record.test.js @@ -172,26 +172,34 @@ var tests = { proxy = new Clipperz.PM.Proxy.Test({shouldPayTolls:false, isDefault:true, readOnly:false}); user = new Clipperz.PM.DataModel.User({username:'joe', getPassphraseFunction:function () { return 'clipperz';}}); user2 = new Clipperz.PM.DataModel.User({username:'joe', getPassphraseFunction:function () { return 'clipperz';}}); deferredResult = new Clipperz.Async.Deferred("Record.test.removeDirectLogin", someTestArgs); deferredResult.addMethod(proxy.dataStore(), 'setupWithEncryptedData', testData['joe_clipperz_offline_copy_data']); deferredResult.addMethod(user, 'login'); + + deferredResult.addMethod(user, 'getRecord', recordID); + deferredResult.addMethodcaller('directLogins'); + deferredResult.addCallback(MochiKit.Base.keys); + deferredResult.addCallback(MochiKit.Base.itemgetter('length')); + deferredResult.addTest(4, "The record initially has 4 direct logins"); + deferredResult.addMethod(user, 'getRecord', recordID); deferredResult.addMethodcaller('directLogins'); deferredResult.addCallback(MochiKit.Base.itemgetter(directLoginID)); deferredResult.addMethodcaller('remove'); deferredResult.addMethod(user, 'getRecord', recordID); deferredResult.addMethodcaller('hasPendingChanges'); deferredResult.addTest(true, "removing a direct login to a record should result in pending changes on the record"); deferredResult.addMethod(user, 'saveChanges'); + deferredResult.addMethod(user, 'hasPendingChanges'); deferredResult.addTest(false, "after saving there should be not any pending changes"); deferredResult.addMethod(user, 'getRecord', recordID); deferredResult.addMethodcaller('directLogins'); deferredResult.addCallback(MochiKit.Base.keys); deferredResult.addCallback(MochiKit.Base.itemgetter('length')); deferredResult.addTest(3, "after saving changes, the record should have only 3 direct logins"); |