From 3dc778d41b2db7a5903314375e7ec366dac93bef Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Mon, 9 Dec 2019 11:14:34 +0100 Subject: [PATCH] Fix cypress tests --- client/src/components/Chapter.vue | 10 ++++++++-- client/src/components/modules/Module.vue | 8 +++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/client/src/components/Chapter.vue b/client/src/components/Chapter.vue index 14366295..b5fd26db 100644 --- a/client/src/components/Chapter.vue +++ b/client/src/components/Chapter.vue @@ -8,7 +8,7 @@ @edit-note="editNote" :bookmarked="chapter.bookmark" @bookmark="bookmark(!chapter.bookmark)" - :note="chapter.bookmark.note" + :note="note" >

{{chapter.description}} @@ -58,6 +58,12 @@ schoolClass() { return this.me.selectedClass; }, + note() { + if (!(this.chapter && this.chapter.bookmark)) { + return; + } + return this.chapter.bookmark.note; + } }, data() { @@ -77,7 +83,7 @@ bookmarked } }, - update: (store, response) => { + update: (store, response) => { const query = CHAPTER_QUERY; const variables = {id}; const data = store.readQuery({ diff --git a/client/src/components/modules/Module.vue b/client/src/components/modules/Module.vue index 6e9b5534..7805b237 100644 --- a/client/src/components/modules/Module.vue +++ b/client/src/components/modules/Module.vue @@ -12,7 +12,7 @@ @add-note="addNote" @edit-note="editNote" :bookmarked="module.bookmark" - :note="module.bookmark.note" + :note="note" @bookmark="bookmark(!module.bookmark)">

@@ -81,6 +81,12 @@ }, isStudent() { return !this.me.permissions.includes('users.can_manage_school_class_content'); + }, + note() { + if (!(this.module && this.module.bookmark)) { + return; + } + return this.module.bookmark.note; } },