mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 06:59:31 +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) {
|
async addNote(note) {
|
||||||
if (!note || !note.content || (!note.title && !note.content))
|
if (!note || !note.content || (!note.title && !note.content))
|
||||||
return undefined;
|
return undefined; //TODO add test
|
||||||
|
|
||||||
let timestamp = note.dateCreated || Date.now();
|
let timestamp = note.dateCreated || Date.now();
|
||||||
//add or update a note into the database
|
//add or update a note into the database
|
||||||
@@ -108,6 +108,7 @@ class Database {
|
|||||||
const id = notebook.dateCreated || Date.now();
|
const id = notebook.dateCreated || Date.now();
|
||||||
let topics = {};
|
let topics = {};
|
||||||
if (notebook.topics) {
|
if (notebook.topics) {
|
||||||
|
//TODO add test
|
||||||
for (let topic of notebook.topics) {
|
for (let topic of notebook.topics) {
|
||||||
topics[topic] = [];
|
topics[topic] = [];
|
||||||
}
|
}
|
||||||
@@ -224,6 +225,7 @@ class Database {
|
|||||||
this.notes[notebookId] = notebook;
|
this.notes[notebookId] = notebook;
|
||||||
return this.storage.write(KEYS.notebooks, this.notebooks);
|
return this.storage.write(KEYS.notebooks, this.notebooks);
|
||||||
}
|
}
|
||||||
|
//TODO add test
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -235,7 +237,7 @@ class Database {
|
|||||||
|
|
||||||
async delete(items, key) {
|
async delete(items, key) {
|
||||||
if (!items || items.length <= 0 || !this[key] || this[key].length <= 0)
|
if (!items || items.length <= 0 || !this[key] || this[key].length <= 0)
|
||||||
return;
|
return; //TODO add test
|
||||||
for (let item of items) {
|
for (let item of items) {
|
||||||
if (this[key].hasOwnProperty(item.dateCreated)) {
|
if (this[key].hasOwnProperty(item.dateCreated)) {
|
||||||
delete this[key][item.dateCreated];
|
delete this[key][item.dateCreated];
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ class Storage {
|
|||||||
return Convert.fromString(data);
|
return Convert.fromString(data);
|
||||||
}
|
}
|
||||||
clear() {
|
clear() {
|
||||||
this.storage.clear();
|
this.storage.clear(); //TODO add test
|
||||||
}
|
}
|
||||||
remove(key) {
|
remove(key) {
|
||||||
this.storage.remove(key);
|
this.storage.remove(key); //TODO add test
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
//TODO add tests
|
||||||
export default class Convert {
|
export default class Convert {
|
||||||
static toString(input) {
|
static toString(input) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user