Fix cypress tests

This commit is contained in:
Ramon Wenger 2019-12-09 11:14:34 +01:00
parent 44ad1e6a8a
commit 3dc778d41b
2 changed files with 15 additions and 3 deletions

View File

@ -8,7 +8,7 @@
@edit-note="editNote" @edit-note="editNote"
:bookmarked="chapter.bookmark" :bookmarked="chapter.bookmark"
@bookmark="bookmark(!chapter.bookmark)" @bookmark="bookmark(!chapter.bookmark)"
:note="chapter.bookmark.note" :note="note"
></bookmark-actions> ></bookmark-actions>
<p class="chapter__description"> <p class="chapter__description">
{{chapter.description}} {{chapter.description}}
@ -58,6 +58,12 @@
schoolClass() { schoolClass() {
return this.me.selectedClass; return this.me.selectedClass;
}, },
note() {
if (!(this.chapter && this.chapter.bookmark)) {
return;
}
return this.chapter.bookmark.note;
}
}, },
data() { data() {
@ -77,7 +83,7 @@
bookmarked bookmarked
} }
}, },
update: (store, response) => { update: (store, response) => {
const query = CHAPTER_QUERY; const query = CHAPTER_QUERY;
const variables = {id}; const variables = {id};
const data = store.readQuery({ const data = store.readQuery({

View File

@ -12,7 +12,7 @@
@add-note="addNote" @add-note="addNote"
@edit-note="editNote" @edit-note="editNote"
:bookmarked="module.bookmark" :bookmarked="module.bookmark"
:note="module.bookmark.note" :note="note"
@bookmark="bookmark(!module.bookmark)"></bookmark-actions> @bookmark="bookmark(!module.bookmark)"></bookmark-actions>
<div class="module__intro" v-html="module.intro"></div> <div class="module__intro" v-html="module.intro"></div>
</div> </div>
@ -81,6 +81,12 @@
}, },
isStudent() { isStudent() {
return !this.me.permissions.includes('users.can_manage_school_class_content'); return !this.me.permissions.includes('users.can_manage_school_class_content');
},
note() {
if (!(this.module && this.module.bookmark)) {
return;
}
return this.module.bookmark.note;
} }
}, },