mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-21 08:36:03 +02:00
Fix LibraryItemController unit test
This commit is contained in:
parent
4787e7fdb5
commit
eb853d9f09
2 changed files with 9 additions and 5 deletions
|
@ -82,11 +82,13 @@ describe('LibraryItemController', () => {
|
|||
})
|
||||
|
||||
it('should remove authors and series with no books on library item delete', async () => {
|
||||
const oldLibraryItem = await Database.libraryItemModel.getOldById(libraryItem1Id)
|
||||
const libraryItem = await Database.libraryItemModel.getExpandedById(libraryItem1Id)
|
||||
const oldLibraryItem = Database.libraryItemModel.getOldLibraryItem(libraryItem)
|
||||
|
||||
const fakeReq = {
|
||||
query: {},
|
||||
libraryItem: oldLibraryItem
|
||||
libraryItem,
|
||||
oldLibraryItem
|
||||
}
|
||||
const fakeRes = {
|
||||
sendStatus: sinon.spy()
|
||||
|
@ -156,7 +158,8 @@ describe('LibraryItemController', () => {
|
|||
})
|
||||
|
||||
it('should remove authors and series with no books on library item update media', async () => {
|
||||
const oldLibraryItem = await Database.libraryItemModel.getOldById(libraryItem1Id)
|
||||
const libraryItem = await Database.libraryItemModel.getExpandedById(libraryItem1Id)
|
||||
const oldLibraryItem = Database.libraryItemModel.getOldLibraryItem(libraryItem)
|
||||
|
||||
// Update library item 1 remove all authors and series
|
||||
const fakeReq = {
|
||||
|
@ -167,7 +170,8 @@ describe('LibraryItemController', () => {
|
|||
series: []
|
||||
}
|
||||
},
|
||||
libraryItem: oldLibraryItem
|
||||
libraryItem,
|
||||
oldLibraryItem
|
||||
}
|
||||
const fakeRes = {
|
||||
json: sinon.spy()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue