feat: add admin inventory Excel export
Quality / test (push) Canceled after 0s

This commit is contained in:
2026-09-10 01:11:07 -04:00
parent d6b4dbec5f
commit 24f51212e5
8 changed files with 91 additions and 0 deletions
@@ -52,3 +52,18 @@ test('exports inventory as escaped CSV rows', async () => {
'"item-1","product-1","condition-1","ACTIVE","Front, ""clean""\nback","",""',
].join('\r\n'));
});
test('exports inventory as an escaped Excel XML workbook', async () => {
const service = createAdminExportService({
inventoryItemService: {
async listBySellerId() {
return [{ id: 'item-1', productId: 'product-1', conditionId: 'condition-1', status: 'ACTIVE', notes: 'A <note>' }];
},
},
});
const workbook = await service.inventoryExcel({ sellerId: 'seller-1' });
assert.match(workbook, /Excel\.Sheet/);
assert.match(workbook, /A &lt;note&gt;/);
assert.match(workbook, /<Cell ss:StyleID="Header"><Data ss:Type="String">id<\/Data><\/Cell>/);
});