Allow searching sellers in client filters
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m5s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m5s
This commit is contained in:
@@ -112,10 +112,20 @@ test('buildDateFilter composes client metadata predicates after date predicates'
|
||||
test('buildDateFilter can filter seller by display name when no seller id is selected', () => {
|
||||
const filter = buildDateFilter({ seller: 'name:Maria' });
|
||||
|
||||
assert.deepEqual(filter.params, ['Maria']);
|
||||
assert.deepEqual(filter.params, ['%Maria%']);
|
||||
assert.equal(
|
||||
filter.whereClause,
|
||||
"WHERE data_pedido_date IS NOT NULL AND NULLIF(TRIM(nome_vendedor), '') = $1"
|
||||
"WHERE data_pedido_date IS NOT NULL AND NULLIF(TRIM(nome_vendedor), '') ILIKE $1"
|
||||
);
|
||||
});
|
||||
|
||||
test('buildDateFilter can search seller names from typed text', () => {
|
||||
const filter = buildDateFilter({ seller: 'MARCUS' });
|
||||
|
||||
assert.deepEqual(filter.params, ['MARCUS', '%MARCUS%']);
|
||||
assert.equal(
|
||||
filter.whereClause,
|
||||
"WHERE data_pedido_date IS NOT NULL AND (NULLIF(TRIM(id_vendedor), '') = $1 OR NULLIF(TRIM(nome_vendedor), '') ILIKE $2)"
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user