Uncomment tests (now that they are guarded by a Fixme)

This commit is contained in:
blagoev 2017-09-21 02:38:22 +03:00
parent 8c8e75aa40
commit 749c88ec74
2 changed files with 66 additions and 66 deletions

View File

@ -46,8 +46,8 @@ if (global.enableSyncTests) {
// FIXME: Permission tests currently fail in chrome debugging mode. // FIXME: Permission tests currently fail in chrome debugging mode.
if (typeof navigator === 'undefined' || if (typeof navigator === 'undefined' ||
!/Chrome/.test(navigator.userAgent)) { // eslint-disable-line no-undef !/Chrome/.test(navigator.userAgent)) { // eslint-disable-line no-undef
//TESTS.PermissionTests = require('./permission-tests'); TESTS.PermissionTests = require('./permission-tests');
} }
} }

View File

@ -303,80 +303,80 @@ module.exports = {
}); });
}, },
// testRetrieveAccount() { testRetrieveAccount() {
// return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// if (!isNodeProcess) { if (!isNodeProcess) {
// resolve(); resolve();
// } }
// if (!global.testAdminUserInfo) { if (!global.testAdminUserInfo) {
// reject("Test requires an admin user"); reject("Test requires an admin user");
// } }
// Realm.Sync.User.login('http://localhost:9080', global.testAdminUserInfo.username, global.testAdminUserInfo.password, (error, user) => { Realm.Sync.User.login('http://localhost:9080', global.testAdminUserInfo.username, global.testAdminUserInfo.password, (error, user) => {
// if (error) { if (error) {
// reject(error); reject(error);
// } }
// TestCase.assertTrue(user.isAdmin, "Test requires an admin user"); TestCase.assertTrue(user.isAdmin, "Test requires an admin user");
// user.retrieveAccount('password', global.testAdminUserInfo.username) user.retrieveAccount('password', global.testAdminUserInfo.username)
// .then(account => { .then(account => {
// // { // {
// // "provider_id": "admin", // "provider_id": "admin",
// // "provider": "password", // "provider": "password",
// // "user": { // "user": {
// // "id": "07ac9a0a-a97a-4ee1-b53c-b05a6542035a", // "id": "07ac9a0a-a97a-4ee1-b53c-b05a6542035a",
// // "isAdmin": true, // "isAdmin": true,
// // } // }
// // } // }
// TestCase.assertEqual(account.provider_id, global.testAdminUserInfo.username); TestCase.assertEqual(account.provider_id, global.testAdminUserInfo.username);
// TestCase.assertEqual(account.provider, 'password'); TestCase.assertEqual(account.provider, 'password');
// TestCase.assertTrue(account.user); TestCase.assertTrue(account.user);
// TestCase.assertTrue(account.user.isAdmin !== undefined); TestCase.assertTrue(account.user.isAdmin !== undefined);
// TestCase.assertTrue(account.user.id); TestCase.assertTrue(account.user.id);
// resolve(); resolve();
// }) })
// .catch(e => reject(e)); .catch(e => reject(e));
// }) })
// }); });
// }, },
// testRetrieveNotExistingAccount() { testRetrieveNotExistingAccount() {
// return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// if (!isNodeProcess) { if (!isNodeProcess) {
// resolve(); resolve();
// } }
// if (!global.testAdminUserInfo) { if (!global.testAdminUserInfo) {
// reject("Test requires an admin user"); reject("Test requires an admin user");
// } }
// Realm.Sync.User.login('http://localhost:9080', global.testAdminUserInfo.username, global.testAdminUserInfo.password, (error, user) => { Realm.Sync.User.login('http://localhost:9080', global.testAdminUserInfo.username, global.testAdminUserInfo.password, (error, user) => {
// if (error) { if (error) {
// reject(error); reject(error);
// } }
// TestCase.assertTrue(user.isAdmin, "Test requires an admin user"); TestCase.assertTrue(user.isAdmin, "Test requires an admin user");
// let notExistingUsername = uuid(); let notExistingUsername = uuid();
// user.retrieveAccount('password', notExistingUsername) user.retrieveAccount('password', notExistingUsername)
// .then(account => { .then(account => {
// reject("Retrieving not existing account should fail"); reject("Retrieving not existing account should fail");
// }) })
// .catch(e => { .catch(e => {
// try { try {
// TestCase.assertEqual(e.code, 404); TestCase.assertEqual(e.code, 404);
// } }
// catch (e) { catch (e) {
// reject(e); reject(e);
// } }
// resolve() resolve()
// }); });
// }) })
// }); });
// }, },
/* This test fails because of realm-object-store #243 . We should use 2 users. /* This test fails because of realm-object-store #243 . We should use 2 users.
testSynchronizeChangesWithTwoClientsAndOneUser() { testSynchronizeChangesWithTwoClientsAndOneUser() {