chore: add comments about all the tests that need to be added

This commit is contained in:
thecodrr
2019-12-04 18:33:01 +05:00
parent fd7b50b5c8
commit 9ec5772cbe
3 changed files with 7 additions and 4 deletions

View File

@@ -33,7 +33,7 @@ class Database {
*/
async addNote(note) {
if (!note || !note.content || (!note.title && !note.content))
return undefined;
return undefined; //TODO add test
let timestamp = note.dateCreated || Date.now();
//add or update a note into the database
@@ -108,6 +108,7 @@ class Database {
const id = notebook.dateCreated || Date.now();
let topics = {};
if (notebook.topics) {
//TODO add test
for (let topic of notebook.topics) {
topics[topic] = [];
}
@@ -224,6 +225,7 @@ class Database {
this.notes[notebookId] = notebook;
return this.storage.write(KEYS.notebooks, this.notebooks);
}
//TODO add test
return Promise.resolve();
}
@@ -235,7 +237,7 @@ class Database {
async delete(items, key) {
if (!items || items.length <= 0 || !this[key] || this[key].length <= 0)
return;
return; //TODO add test
for (let item of items) {
if (this[key].hasOwnProperty(item.dateCreated)) {
delete this[key][item.dateCreated];