Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexAndBear committed Feb 23, 2024
1 parent 5d4b552 commit 789a14b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
1 change: 0 additions & 1 deletion packages/web-app-epub-reader/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ export default defineComponent({
}
const showChapter = (chapter: NavItem) => {
console.log("SHOW CHAPTER")
unref(rendition).display(chapter.href)
}
Expand Down
12 changes: 1 addition & 11 deletions packages/web-app-epub-reader/tests/unit/app.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ vi.mock('epubjs', () => ({
navigation: Promise.resolve({
toc: [
{ id: '1', label: 'Chapter 1', href: 'c1' },
{ id: '1', label: 'Chapter 2', href: 'c2' }
{ id: '2', label: 'Chapter 2', href: 'c2' }
]
})
},
Expand Down Expand Up @@ -152,17 +152,7 @@ describe('Epub reader app', () => {
const chapterElements = await getOcSelectOptions(wrapper, selectors.chaptersSelect, {
close: false
})
await nextTicks(2)
console.log(wrapper.html())

console.log(wrapper.find(selectors.chaptersSelect).find('li:nth-child(2)').html())

await wrapper.find('li:nth-child(2)').trigger('click')

await chapterElements[1].trigger('click')

await nextTicks(2)
console.log(wrapper.find(selectors.chaptersSelect).html())
expect(wrapper.vm.rendition.display).toHaveBeenCalledWith('c2')
})
})
Expand Down

0 comments on commit 789a14b

Please sign in to comment.