mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-29 22:01:49 +03:00
Added labels test for empty browse response
- Added a simple test to prove the response is in the correct format when there is no results
This commit is contained in:
parent
a7566c8503
commit
6976a3a9f2
@ -66,6 +66,34 @@ Object {
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Labels API Can browse with no labels 1: [body] 1`] = `
|
||||
Object {
|
||||
"labels": Array [],
|
||||
"meta": Object {
|
||||
"pagination": Object {
|
||||
"limit": 15,
|
||||
"next": null,
|
||||
"page": 1,
|
||||
"pages": 1,
|
||||
"prev": null,
|
||||
"total": 0,
|
||||
},
|
||||
},
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Labels API Can browse with no labels 2: [headers] 1`] = `
|
||||
Object {
|
||||
"access-control-allow-origin": "http://127.0.0.1:2369",
|
||||
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
|
||||
"content-length": "101",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
||||
"vary": "Origin, Accept-Encoding",
|
||||
"x-powered-by": "Express",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Labels API Can destroy 1: [body] 1`] = `
|
||||
Object {
|
||||
"labels": Array [
|
||||
|
@ -16,6 +16,16 @@ describe('Labels API', function () {
|
||||
await agent.loginAsOwner();
|
||||
});
|
||||
|
||||
it('Can browse with no labels', async function () {
|
||||
await agent
|
||||
.get('labels')
|
||||
.expectStatus(200)
|
||||
.matchBodySnapshot()
|
||||
.matchHeaderSnapshot({
|
||||
etag: anyEtag
|
||||
});
|
||||
});
|
||||
|
||||
it('Can add', async function () {
|
||||
await agent
|
||||
.post('labels')
|
||||
|
Loading…
Reference in New Issue
Block a user