test: improve test
gitea/salix-front/pipeline/pr-master This commit looks good
Details
gitea/salix-front/pipeline/pr-master This commit looks good
Details
This commit is contained in:
parent
750ce68f97
commit
68e1b2ed27
|
@ -16,10 +16,19 @@ describe('getItemPackagingType', () => {
|
||||||
const ticketSales = [
|
const ticketSales = [
|
||||||
{ item: { itemPackingTypeFk: 'H' } },
|
{ item: { itemPackingTypeFk: 'H' } },
|
||||||
{ item: { itemPackingTypeFk: 'V' } },
|
{ item: { itemPackingTypeFk: 'V' } },
|
||||||
{ item: { itemPackingTypeFk: 'H' } }, // Duplicado
|
{ item: { itemPackingTypeFk: 'H' } },
|
||||||
];
|
];
|
||||||
expect(getItemPackagingType(ticketSales)).toBe('H, V');
|
expect(getItemPackagingType(ticketSales)).toBe('H, V');
|
||||||
});
|
});
|
||||||
|
it('should return unique packaging types as a comma-separated string', () => {
|
||||||
|
const ticketSales = [
|
||||||
|
{ item: { itemPackingTypeFk: 'H' } },
|
||||||
|
{ item: { itemPackingTypeFk: 'V' } },
|
||||||
|
{ item: { itemPackingTypeFk: 'H' } },
|
||||||
|
{ item: { itemPackingTypeFk: 'A' } },
|
||||||
|
];
|
||||||
|
expect(getItemPackagingType(ticketSales)).toBe('H, V, A');
|
||||||
|
});
|
||||||
|
|
||||||
it('should return "-" if ticketSales is an empty array', () => {
|
it('should return "-" if ticketSales is an empty array', () => {
|
||||||
expect(getItemPackagingType([])).toBe('-');
|
expect(getItemPackagingType([])).toBe('-');
|
||||||
|
|
Loading…
Reference in New Issue