mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-22 22:49:45 +01:00
chore: add comments about all the tests that need to be added
This commit is contained in:
@@ -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];
|
||||
|
||||
@@ -12,10 +12,10 @@ class Storage {
|
||||
return Convert.fromString(data);
|
||||
}
|
||||
clear() {
|
||||
this.storage.clear();
|
||||
this.storage.clear(); //TODO add test
|
||||
}
|
||||
remove(key) {
|
||||
this.storage.remove(key);
|
||||
this.storage.remove(key); //TODO add test
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//TODO add tests
|
||||
export default class Convert {
|
||||
static toString(input) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user