Commit Graph

17 Commits

Author SHA1 Message Date
astigsen db4e184524 Added method to find index of object in collections (#1094)
* Added method to find index of object in collections

* rework as the indexOf method
2017-06-26 13:43:49 +02:00
Kristian Dupont 0c9c5ac407 Add missing chrome debugging apis for Sync.User (#801)
* Add user tests

* Add Sync member to Realm

* Add a simple test for addListener

* Introduce browser User class

* Introduce Sync.User proxy

* Fix User.all

* Add User.logout

* Remove some console.log statements

* Update rpc.cpp from tests-folder

* Use user.current from user-methods, not cpp

* remove user.current from two missing places

* Start server in realmjs and react tests

* Add user tests

* Add Sync member to Realm

* Add a simple test for addListener

* Introduce browser User class

* Introduce Sync.User proxy

* Fix User.all

* Add User.logout

* Remove some console.log statements

* Update rpc.cpp from tests-folder

* Use user.current from user-methods, not cpp

* remove user.current from two missing places

* Start server in realmjs and react tests

* Replace needle with node-fetch

* Make AuthError work in the browser

* Allow for persistent callbacks

* Expose _authenticateRealm to native

* Use clear_test_state in roc

* Streamline test inclusion

* Fix login tests

* Promisify testLogin()

* Disable AsyncTests for now

* Mode jasmine timeout to spec/unit_tests.js

* Avoid use of global for fetch module

* Only include user-tests is sync is enabled

* Skip ROS for android tests

* Add some comments about persistent callbacks

* Fix results-test

* Run async-tests in node

* Add a comment about (user object)

* Cache all users in User.current and return promises in fetch

* node_require async-tests so RN doesn't try and package them

* Add missing parenthesis
2017-01-31 14:07:29 +01:00
Scott Kyle cd20d870dd Fix crash from querying with object from another Realm 2016-06-09 15:32:37 -07:00
Scott Kyle af70bb3c63 Fix all linting issues inside JS tests 2016-05-26 15:47:30 -07:00
Scott Kyle 48394d9c19 Automatically handle deleting test Realms
No longer leave this up to the test. All testing passes through the runTest() function, so we use that spot to delete the Realms. It also now deletes them beforehand too since a crash in a previous run could leave a Realm in place.
2016-05-26 15:47:30 -07:00
Scott Kyle 60a58382b4 Add tests where deletion happens before snapshot() 2016-05-24 10:23:36 -07:00
Scott Kyle e14e922c39 Fix crash and other errors with Results snapshots
When deleteAll() is called on a Realm, it calls clear() on all of its Tables, which seems to not update TableViews unless they are synced. The is_row_attached(row_ndx) method still returns true otherwise. A workaround is here until that is fixed.

Fixes #434
2016-05-20 13:42:17 -07:00
Ari Lazier fd25afe214 add isValid methods to results and list 2016-05-16 16:01:14 -07:00
Scott Kyle 26d2c169a9 Support ES6 class inheritance from Realm.Object
Unfortunately, this was broken because our native Realm.Object constructor was not presenting itself as a function in JS. This fixes that and adds tests.
2016-05-09 16:49:05 -07:00
Scott Kyle 4705b6b3a5 Add test for Results invalidation
This triggers a crash!
2016-04-28 09:39:06 -07:00
Ari Lazier 3509caedd5 bugfix for empty results, fix for realm.isValid 2016-04-19 17:29:34 -07:00
Scott Kyle b5ce02c0ce Make List and Results inherit from Collection
This will allow for easier type checking, documentation, etc.
2016-03-20 11:51:16 -07:00
Ari Lazier c42834d052 test strings too 2016-03-04 07:58:25 -08:00
Ari Lazier 621ee36fad test sorting all properties 2016-03-04 07:55:05 -08:00
Scott Kyle 4ea2e729b4 Support many Array methods on List and Results
Resolves #18
2016-02-29 03:24:58 -08:00
Scott Kyle 236d0a5eed Ensure List and Results constructors throw exception
This was already done from native code, but needed to happen for the browser shim and be tested.
2016-02-29 03:24:58 -08:00
Scott Kyle a5ec799a7c Copy whole lib module into JS test bundle
This meant we needed to rename tests/lib to tests/js so they folder names would not conflict.
2016-02-29 03:24:58 -08:00