This commit is contained in:
@@ -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 <note>/);
|
||||
assert.match(workbook, /<Cell ss:StyleID="Header"><Data ss:Type="String">id<\/Data><\/Cell>/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user