fix: remove leading campaign product bullet
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m42s

This commit is contained in:
Cauê Faleiros
2026-06-10 16:07:55 -03:00
parent 7e3d0be595
commit 5883dc6298
2 changed files with 5 additions and 5 deletions

View File

@@ -17,7 +17,7 @@ const formatProductNameForDisplay = (name) => {
const formatProductList = (productNames) => {
const displayNames = productNames.map(formatProductNameForDisplay);
return displayNames.map(name => `${name}`).join(' ');
return displayNames.join(' ');
};
const groupCampaignRowsByBaseProduct = (rows) => {

View File

@@ -27,11 +27,11 @@ const row = (overrides) => ({
test('formatProductList uses inline bullet separators', () => {
assert.equal(formatProductList([]), '');
assert.equal(formatProductList(['BONÉ - PRETO']), 'Boné - Preto');
assert.equal(formatProductList(['BONÉ - PRETO', 'BASE BRANCA']), 'Boné - Preto • Base Branca');
assert.equal(formatProductList(['BONÉ - PRETO']), 'Boné - Preto');
assert.equal(formatProductList(['BONÉ - PRETO', 'BASE BRANCA']), 'Boné - Preto • Base Branca');
assert.equal(
formatProductList(['BONÉ - PRETO', 'BASE BRANCA', 'BASE PRETA']),
'Boné - Preto • Base Branca • Base Preta'
'Boné - Preto • Base Branca • Base Preta'
);
});
@@ -94,7 +94,7 @@ test('buildWhatsappCampaignPayload combines multiple ready products into one mes
]));
const payload = buildWhatsappCampaignPayload(products, [{ nome: 'Cliente', fone: '5511999999999' }]);
assert.equal(payload.productsText, 'Boné - Preto • Camiseta Premium Cor Branco');
assert.equal(payload.productsText, 'Boné - Preto • Camiseta Premium Cor Branco');
assert.equal(payload.baseProduct, payload.productsText);
assert.equal(payload.total_delta, 200);
assert.equal(payload.products.length, 2);