Skip to content
Snippets Groups Projects
Commit 4c6cb9fe authored by Jakob Lønnerød Madsen's avatar Jakob Lønnerød Madsen
Browse files

Update persondao.test.js

parent 2e71432e
Branches
No related tags found
No related merge requests found
Pipeline #49938 failed
...@@ -77,3 +77,30 @@ test("get all persons from db", done => { ...@@ -77,3 +77,30 @@ test("get all persons from db", done => {
personDao.getAll(callback); personDao.getAll(callback);
}); });
test("remove person from db", done => {
function callback(status, data) {
console.log(
"Test callback: status=" + status + ", data.length=" + data.length
);
expect(data.affectedRows).toBe(1);
done();
}
id = 1
personDao.deleteOne(id, callback);
});
test("update person in db", done => {
function callback(status, data) {
console.log(
"Test callback: status=" + status + ", data.length=" + data.length
);
expect(data.affectedRows).toBe(1);
done();
}
id = 1;
newName = "NyttNavn jonsen";
newAdress = "NyVei Adresse";
json = {"id": id, "navn": newName, "adresse": newAdress}
personDao.updateOne(json, callback);
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment