Refactor stock API to replace numeric flags with boolean values, add getItemLabel endpoint, and update tests/documentation
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -61,12 +61,12 @@ describe('api/client', () => {
|
||||
|
||||
const url = buildKitchenApiUrl(store, 'kitchen/items/grouped', {
|
||||
search_name: 'Milk + eggs',
|
||||
expanded: 1,
|
||||
expanded: true,
|
||||
ignored: '',
|
||||
});
|
||||
|
||||
expect(url).toBe(
|
||||
'https://api.example.com/my%20db/kitchen/items/grouped?search_name=Milk+%2B+eggs&expanded=1',
|
||||
'https://api.example.com/my%20db/kitchen/items/grouped?search_name=Milk+%2B+eggs&expanded=true',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -88,14 +88,14 @@ describe('api/client', () => {
|
||||
name: 'Rice',
|
||||
},
|
||||
query: {
|
||||
label: 1,
|
||||
label: true,
|
||||
},
|
||||
});
|
||||
|
||||
expect(payload).toEqual({ ok: true });
|
||||
|
||||
const [url, request] = fetchSpy.mock.calls[0];
|
||||
expect(url).toBe('/kitchen-db/kitchen/items?label=1');
|
||||
expect(url).toBe('/kitchen-db/kitchen/items?label=true');
|
||||
expect(request.method).toBe('POST');
|
||||
expect(request.body).toBe('{"name":"Rice"}');
|
||||
expect(request.headers.get('Accept')).toBe('application/json');
|
||||
|
||||
Reference in New Issue
Block a user