All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m44s
24 lines
807 B
JavaScript
24 lines
807 B
JavaScript
const assert = require('node:assert/strict');
|
|
const test = require('node:test');
|
|
|
|
const { getBaseProductName } = require('../mappers/stockMapper');
|
|
|
|
test('getBaseProductName strips TAMANHO suffixes', () => {
|
|
assert.equal(
|
|
getBaseProductName('BASE LISA CAMISETA COR BRANCO TAMANHO - P'),
|
|
'BASE LISA CAMISETA COR BRANCO'
|
|
);
|
|
});
|
|
|
|
test('getBaseProductName strips trailing size suffixes without removing colors', () => {
|
|
assert.equal(
|
|
getBaseProductName('BASE LISA MOLETOM CANGURU COR PRETO - M'),
|
|
'BASE LISA MOLETOM CANGURU COR PRETO'
|
|
);
|
|
assert.equal(
|
|
getBaseProductName('BASE LISA MOLETOM CANGURU COR PRETO - M/G/GG'),
|
|
'BASE LISA MOLETOM CANGURU COR PRETO'
|
|
);
|
|
assert.equal(getBaseProductName('BONÉ - BRANCO'), 'BONÉ - BRANCO');
|
|
});
|