Small gaps: pantry flags in the meal plan, birthday and anniversary notifications, download notes and highlights
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
342c8af747
commit
b2b772941b
9 files changed
+46
-4
No files matched your search
@@ -62,6 +62,11 @@ const fake = http.createServer((req, res) => {
|
||||
j = await (await post('/plan/shop', { from: '2027-03-02', to: '2027-03-08' })).json(); assert.equal(j.ok, true); assert.equal(j.recipes, 1, 'a recipe planned twice is added once, twice over');
|
||||
assert.equal((await post('/plan/shop', { from: '2027-04-01', to: '2027-04-07' })).status, 400, 'nothing planned, nothing to add');
|
||||
await post('/plan/remove', { id: (await (await get('/plan?from=2027-03-02&to=2027-03-02')).json())['2027-03-02'][0].id }); assert.deepEqual(await (await get('/plan?from=2027-03-02&to=2027-03-02')).json(), {});
|
||||
// the pantry flags planned ingredients you already have ("3 cups flour" is covered by "flour"; butter is not in the pantry)
|
||||
await post('/plan/add', { date: '2027-05-03', slug: 'bread', name: 'Bread' });
|
||||
j = await (await post('/pantry', { items: 'Flour\n \nflour, Salt' })).json(); assert.deepEqual(j.items, ['Flour', 'flour', 'Salt'].filter((x, i, a) => a.indexOf(x) === i), 'trimmed and de-duplicated by exact text');
|
||||
j = await (await get('/plan/pantry?from=2027-05-03&to=2027-05-09')).json(); assert.deepEqual(j.items.map(i => i.text), ['3 cups flour']); assert.equal(j.items[0].have.toLowerCase(), 'flour');
|
||||
await post('/pantry', { items: [] }); assert.deepEqual((await (await get('/plan/pantry?from=2027-05-03&to=2027-05-09')).json()).items, [], 'an empty pantry flags nothing');
|
||||
// a wrong token is explained
|
||||
process.env.MEALIE_TOKEN = 'bad'; r = await get('/'); assert.equal(r.status, 502); assert.match((await r.json()).error, /token/);
|
||||
process.env.MEALIE_TOKEN = ''; assert.equal((await get('/')).status, 503);
|
||||
|
||||
Reference in new issue
Block a user