Skip to content

Commit

Permalink
A few fixes to dbSearch() tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
arnemorken committed Dec 16, 2023
1 parent 99281b8 commit 137cb15
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions tests/TestModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function testModel()
dm1.permission.current_user_id === null &&
dm1.permission.is_logged_in === true &&
dm1.permission.is_admin === false &&
dm1.message !== "" &&
dm1.message === "" &&
dm1.error === "" &&
dm1.error_server === "" &&
dm1.db_timeout_sec === 10,
Expand Down Expand Up @@ -922,12 +922,12 @@ function testModel()
deepEqual(dm.data !== null,
true, "dbSearch({id:"+myid+"}) returns item data:"+JSON.stringify(dm.data));
deepEqual(dm.data &&
dm.data[myid] &&
dm.data[myid].data &&
dm.data[myid].data[idchk] &&
parseInt(dm.data[myid].data[idchk][dm.id_key]) === parseInt(myid) &&
(dm.data[myid].data[idchk][dm.name_key] === uname ||
dm.data[myid].data[idchk]["user_login"] === ulogin),
dm.data[idchk] &&
dm.data[idchk].data &&
dm.data[idchk].data[idchk] &&
parseInt(dm.data[idchk].data[idchk][dm.id_key]) === parseInt(myid) &&
(dm.data[idchk].data[idchk][dm.name_key] === uname ||
dm.data[idchk].data[idchk]["user_login"] === ulogin),
true, "dbSearch({id:"+myid+"}) returns expected data");
start();
},
Expand All @@ -948,11 +948,11 @@ function testModel()
deepEqual(dm.data !== null,
true, "dbSearch({id:"+myid+"}) returns item data:"+JSON.stringify(dm.data));
deepEqual(dm.data &&
dm.data[myid] &&
dm.data[myid].data &&
parseInt(dm.data[myid].data[idchk][dm.id_key]) === parseInt(myid) &&
(dm.data[myid].data[idchk][dm.name_key] === uname ||
dm.data[myid].data[idchk]["user_login"] === ulogin),
dm.data[idchk] &&
dm.data[idchk].data &&
parseInt(dm.data[idchk].data[idchk][dm.id_key]) === parseInt(myid) &&
(dm.data[idchk].data[idchk][dm.name_key] === uname ||
dm.data[idchk].data[idchk]["user_login"] === ulogin),
true, "dbSearch({id:"+myid+"}) returns expected data");
start();
}, millisec);
Expand Down

0 comments on commit 137cb15

Please sign in to comment.