fix: remove leading campaign product bullet
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m42s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m42s
This commit is contained in:
@@ -17,7 +17,7 @@ const formatProductNameForDisplay = (name) => {
|
|||||||
const formatProductList = (productNames) => {
|
const formatProductList = (productNames) => {
|
||||||
const displayNames = productNames.map(formatProductNameForDisplay);
|
const displayNames = productNames.map(formatProductNameForDisplay);
|
||||||
|
|
||||||
return displayNames.map(name => `• ${name}`).join(' ');
|
return displayNames.join(' • ');
|
||||||
};
|
};
|
||||||
|
|
||||||
const groupCampaignRowsByBaseProduct = (rows) => {
|
const groupCampaignRowsByBaseProduct = (rows) => {
|
||||||
|
|||||||
@@ -27,11 +27,11 @@ const row = (overrides) => ({
|
|||||||
|
|
||||||
test('formatProductList uses inline bullet separators', () => {
|
test('formatProductList uses inline bullet separators', () => {
|
||||||
assert.equal(formatProductList([]), '');
|
assert.equal(formatProductList([]), '');
|
||||||
assert.equal(formatProductList(['BONÉ - PRETO']), '• Boné - Preto');
|
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']), 'Boné - Preto • Base Branca');
|
||||||
assert.equal(
|
assert.equal(
|
||||||
formatProductList(['BONÉ - PRETO', 'BASE BRANCA', 'BASE PRETA']),
|
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' }]);
|
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.baseProduct, payload.productsText);
|
||||||
assert.equal(payload.total_delta, 200);
|
assert.equal(payload.total_delta, 200);
|
||||||
assert.equal(payload.products.length, 2);
|
assert.equal(payload.products.length, 2);
|
||||||
|
|||||||
Reference in New Issue
Block a user