0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-05 10:12:41 +00:00
This commit is contained in:
G.Ambatte
2023-06-25 14:39:42 +12:00
parent 782aa8e658
commit ffa240f78d

View File

@@ -125,7 +125,7 @@ describe('Tests for api', ()=>{
describe('getBrew', ()=>{ describe('getBrew', ()=>{
const toBrewPromise = (brew)=>new Promise((res)=>res({ toObject: ()=>brew })); const toBrewPromise = (brew)=>new Promise((res)=>res({ toObject: ()=>brew }));
const notFoundError = 'Brew not found in Homebrewery database or Google Drive'; const notFoundError = { HBErrorCode: '04', message: 'Brew not found', name: 'BrewLoad Error', status: 404 };
it('returns middleware', ()=>{ it('returns middleware', ()=>{
const getFn = api.getBrew('share'); const getFn = api.getBrew('share');
@@ -162,7 +162,7 @@ describe('Tests for api', ()=>{
err = e; err = e;
} }
expect(err).toEqual({ 'message': notFoundError }); expect(err).toEqual(notFoundError);
expect(req.brew).toEqual({}); expect(req.brew).toEqual({});
expect(next).not.toHaveBeenCalled(); expect(next).not.toHaveBeenCalled();
expect(api.getId).toHaveBeenCalledWith(req); expect(api.getId).toHaveBeenCalledWith(req);