feat: add Product tags and bulk tag updates
Quality / test (push) Canceled after 0s

This commit is contained in:
2026-09-10 00:51:05 -04:00
parent 7c9518923d
commit d6b4dbec5f
22 changed files with 236 additions and 4 deletions
+24
View File
@@ -92,4 +92,28 @@ test('enqueues selected admin inventory pricing refreshes through the bulk API',
} finally {
globalThis.fetch = originalFetch;
}
});
test('updates selected admin inventory tags through the bulk API', async () => {
const originalFetch = globalThis.fetch;
globalThis.fetch = async (url, options) => {
assert.equal(url, '/api/v1/admin/bulk');
assert.equal(options.method, 'POST');
assert.deepEqual(JSON.parse(options.body), {
action: 'TAGS',
inventoryItemIds: ['item-1'],
add: ['binder'],
remove: [],
});
return { ok: true, async json() { return { data: [{ id: 'product-1', tags: ['binder'] }] }; } };
};
try {
const { updateAdminInventoryTags } = await import('../src/services/admin-catalog-service.js');
assert.deepEqual(await updateAdminInventoryTags(['item-1'], ['binder'], [], 'csrf-token'), [
{ id: 'product-1', tags: ['binder'] },
]);
} finally {
globalThis.fetch = originalFetch;
}
});