feat: configure and display public seller descriptions
Quality / test (push) Canceled after 0s

This commit is contained in:
2026-09-10 07:40:18 -04:00
parent e630a89e8d
commit 94c37250d1
22 changed files with 158 additions and 6 deletions
@@ -40,3 +40,19 @@ test('rejects unknown or invalid settings', async () => {
() => service.update({ sellerId: 'seller-1', settings: { secrets: { token: 'nope' } } }),
);
});
test('seller descriptions are trimmed, bounded, preserved on partial updates and clearable', async () => {
let stored;
const service = createSellerSettingsService({ sellerSettingsRepository: {
async findBySellerId() { return stored; },
async upsert(sellerId, settings) { stored = { sellerId, settings }; return stored; },
} });
const update = (general) => service.update({ sellerId: 'seller-1', settings: { general } });
assert.equal((await update({ publicDescription: ' Collector. ' })).general.publicDescription, 'Collector.');
assert.equal((await update({ publicContactPhone: '555-0100' })).general.publicDescription, 'Collector.');
await assert.rejects(() => update({ publicDescription: 'x'.repeat(2001) }));
await assert.rejects(() => update({ publicDescription: 123 }));
assert.equal((await update({ publicDescription: 'x'.repeat(2000) })).general.publicDescription.length, 2000);
assert.equal((await update({ publicDescription: ' ' })).general.publicDescription, '');
});