diff --git a/ghost/ghost/src/core/snippets/snippets.service.test.ts b/ghost/ghost/src/core/snippets/snippets.service.test.ts index fa4bbb246f..0c074a8b87 100644 --- a/ghost/ghost/src/core/snippets/snippets.service.test.ts +++ b/ghost/ghost/src/core/snippets/snippets.service.test.ts @@ -18,7 +18,9 @@ describe('SnippetService', () => { assert(allSnippets[0].name === snippet.name); const updated = await service.update(snippet.id, { - name: 'Updated Name' + name: 'Updated Name', + lexical: '{}', + mobiledoc: '{}' }); assert(updated); @@ -30,10 +32,22 @@ describe('SnippetService', () => { assert(pageOfSnippets.data[0].name === updated.name); - await service.delete(snippet.id); + const deleted = await service.delete(snippet.id); + + assert(deleted); + + const cannotDelete = await service.delete(deleted.id); + + assert(!cannotDelete); + + const cannotUpdate = await service.update(deleted.id, { + name: 'Updated Again' + }); + + assert(!cannotUpdate); const notFound = await service.getOne(snippet.id); - assert(notFound === null); + assert(!notFound); }); }); diff --git a/ghost/ghost/src/core/snippets/snippets.service.ts b/ghost/ghost/src/core/snippets/snippets.service.ts index cfc8f77004..89c4edcc08 100644 --- a/ghost/ghost/src/core/snippets/snippets.service.ts +++ b/ghost/ghost/src/core/snippets/snippets.service.ts @@ -66,8 +66,8 @@ export class SnippetsService { async getPage(options: {filter?: string, page: number, limit: number}) { const filter = options.filter; - const page = options.page || 1; - const limit = options.limit || 15; + const page = options.page; + const limit = options.limit; const data = await this.repository.getSome({ count: limit,