diff --git a/dao/persondao.test.js b/dao/persondao.test.js index 79f786bff02a1e925f42f400f2d811203a9188d0..532afb796171146cc492cef7d80268078c79027f 100644 --- a/dao/persondao.test.js +++ b/dao/persondao.test.js @@ -77,3 +77,31 @@ test("get all persons from db", done => { personDao.getAll(callback); }); + +test("update a person in the db", done => { + function callback(status, data) { + console.log( + "Test callback: status=" + status + ", data=" + JSON.stringify(data) + ); + expect(data[0].navn).toBe("Test"); + done(); + } + + personDao.updateOne(1, + {navn:"Test",adresse:"Gata 5",alder:45}, + callback); +}); + +test("remove a person from db", done => { + function callback(status, data) { + console.log( + "Test callback: status=" + status + ", data=" + JSON.stringify(data) + ); + expect(data.length).toBe(1); + done(); + } + + personDao.deleteOne(1, callback); +}); + +