Files
pokemon-inventory/apps/api/tests/application/admin-export-service.test.js
T
2026-09-10 00:16:04 -04:00

34 lines
1.0 KiB
JavaScript

import assert from 'node:assert/strict';
import test from 'node:test';
import { createAdminExportService } from '../../src/modules/exports/services/admin-export-service.js';
test('exports seller inventory through the admin DTO boundary', async () => {
const service = createAdminExportService({
inventoryItemService: {
async listBySellerId(sellerId) {
assert.equal(sellerId, 'seller-1');
return [{
id: 'item-1',
productId: 'product-1',
conditionId: 'condition-1',
status: 'ACTIVE',
notes: 'Private note',
createdAt: new Date('2026-09-10T00:00:00.000Z'),
updatedAt: new Date('2026-09-10T00:00:00.000Z'),
}];
},
},
});
assert.deepEqual(await service.inventoryJson({ sellerId: 'seller-1' }), [{
id: 'item-1',
productId: 'product-1',
conditionId: 'condition-1',
status: 'ACTIVE',
notes: 'Private note',
createdAt: '2026-09-10T00:00:00.000Z',
updatedAt: '2026-09-10T00:00:00.000Z',
}]);
});