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:
Hannah Wolfe 2022-03-24 10:55:25 +00:00
parent a7566c8503
commit 6976a3a9f2
No known key found for this signature in database
GPG Key ID: AB586C3B5AE5C037
2 changed files with 38 additions and 0 deletions

View File

@ -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 [

View File

@ -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')