Clean seller metadata display names
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 40s

This commit is contained in:
Cauê Faleiros
2026-06-24 13:03:55 -03:00
parent b129307bae
commit ca9615a1fd
5 changed files with 57 additions and 13 deletions

View File

@@ -641,6 +641,7 @@ test('getClientFilterOptions returns all distinct order metadata options', async
rows: [
{ id: 'VEN-1', name: 'Maria' },
{ id: '', name: 'Sem ID' },
{ id: '', name: 'KEDMA DA SILVA #977226210' },
{ id: 'VEN-1', name: 'Maria' }
]
};
@@ -657,12 +658,15 @@ test('getClientFilterOptions returns all distinct order metadata options', async
});
assert.match(calls[0].sql, /WHERE NULLIF\(TRIM\(marketplace\), ''\) IS NOT NULL/);
assert.match(calls[2].sql, /WITH seller_options AS/);
assert.match(calls[2].sql, /substring\(NULLIF\(TRIM\(nome_vendedor\), ''\) from/);
assert.match(calls[2].sql, /regexp_replace\(COALESCE\(nome_vendedor, ''\)/);
assert.match(calls[2].sql, /NULLIF\(TRIM\(nome_vendedor\), ''\) IS NOT NULL/);
assert.deepEqual(options.marketplaces, ['Mercado Livre', 'Shopee']);
assert.deepEqual(options.salesChannels, ['Online']);
assert.deepEqual(options.sellers, [
{ value: 'id:VEN-1', id: 'VEN-1', name: 'Maria' },
{ value: 'name:Sem ID', id: '', name: 'Sem ID' }
{ value: 'name:Sem ID', id: '', name: 'Sem ID' },
{ value: 'id:977226210', id: '977226210', name: 'KEDMA DA SILVA' }
]);
} finally {
pool.query = originalQuery;