feat: simplify event date labels in product components for clearer display
This commit is contained in:
@@ -23,7 +23,8 @@
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
top: 76px;
|
top: 76px;
|
||||||
right: calc((100% - 1320px) / 2 + 1.5rem);
|
right: calc((100% - 1320px) / 2 + 1.5rem);
|
||||||
|
width: 100%;
|
||||||
|
max-width: 400px;
|
||||||
max-height: calc(100vh - 120px);
|
max-height: calc(100vh - 120px);
|
||||||
z-index: 1050;
|
z-index: 1050;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
@@ -40,6 +41,7 @@
|
|||||||
right: 1rem;
|
right: 1rem;
|
||||||
left: 1rem;
|
left: 1rem;
|
||||||
width: auto;
|
width: auto;
|
||||||
|
max-width: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -349,14 +349,14 @@ describe('ProductDetailPageComponent', () => {
|
|||||||
{
|
{
|
||||||
id: 20,
|
id: 20,
|
||||||
value: '20',
|
value: '20',
|
||||||
label: '09/10/2026 · 10:00 a 20:00',
|
label: '09/10/2026',
|
||||||
sort_order: 0,
|
sort_order: 0,
|
||||||
metadata: null,
|
metadata: null,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 21,
|
id: 21,
|
||||||
value: '21',
|
value: '21',
|
||||||
label: '10/10/2026 · 10:00 a 20:00',
|
label: '10/10/2026',
|
||||||
sort_order: 1,
|
sort_order: 1,
|
||||||
metadata: null,
|
metadata: null,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ describe('ProductVerticalWithCartCardComponent', () => {
|
|||||||
fixture.componentRef.setInput('variants', [
|
fixture.componentRef.setInput('variants', [
|
||||||
{
|
{
|
||||||
id: 10,
|
id: 10,
|
||||||
values: { event_date: { value: '2', label: '10/10/2026 · 09:00 a 18:00' } },
|
values: { event_date: { value: '2', label: '10/10/2026' } },
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
@@ -150,7 +150,7 @@ describe('ProductVerticalWithCartCardComponent', () => {
|
|||||||
'.product-vertical-with-cart-card__variant-select option',
|
'.product-vertical-with-cart-card__variant-select option',
|
||||||
) as HTMLOptionElement;
|
) as HTMLOptionElement;
|
||||||
|
|
||||||
expect(option.textContent?.trim()).toBe('10/10/2026 · 09:00 a 18:00');
|
expect(option.textContent?.trim()).toBe('10/10/2026');
|
||||||
expect((fixture.componentInstance as any).selectedValues()).toEqual({ event_date: '2' });
|
expect((fixture.componentInstance as any).selectedValues()).toEqual({ event_date: '2' });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -47,13 +47,13 @@ describe('VariantSelectorComponent', () => {
|
|||||||
fixture.componentRef.setInput('variants', [
|
fixture.componentRef.setInput('variants', [
|
||||||
{
|
{
|
||||||
value: 1,
|
value: 1,
|
||||||
values: { event_date: { value: '2', label: '10/10/2026 · 09:00 a 18:00' } },
|
values: { event_date: { value: '2', label: '10/10/2026' } },
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
|
||||||
const option = fixture.nativeElement.querySelector('option') as HTMLOptionElement;
|
const option = fixture.nativeElement.querySelector('option') as HTMLOptionElement;
|
||||||
expect(option.textContent?.trim()).toBe('10/10/2026 · 09:00 a 18:00');
|
expect(option.textContent?.trim()).toBe('10/10/2026');
|
||||||
expect((fixture.componentInstance as any).selectedValues()).toEqual({ event_date: '2' });
|
expect((fixture.componentInstance as any).selectedValues()).toEqual({ event_date: '2' });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user