From 472e04aa67fcf26aa56a5fcbdfa3b9eb1c065bb9 Mon Sep 17 00:00:00 2001 From: jonathan Date: Mon, 13 Jul 2026 12:45:18 -0400 Subject: [PATCH 1/2] feat(calendar): agrega clase isCourse al texto de curso --- .../Calendar/EventsList/EventsList.test.tsx | 12 ++++++++++++ src/organisms/Calendar/EventsList/EventsList.tsx | 11 ++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/organisms/Calendar/EventsList/EventsList.test.tsx b/src/organisms/Calendar/EventsList/EventsList.test.tsx index 8ab69b31..8aef7c30 100644 --- a/src/organisms/Calendar/EventsList/EventsList.test.tsx +++ b/src/organisms/Calendar/EventsList/EventsList.test.tsx @@ -111,4 +111,16 @@ describe('EventsList', () => { expect(screen.queryByText('Curso:')).not.toBeInTheDocument() expect(screen.getByText('Curso demo')).toBeInTheDocument() }) + + it('adds isCourse class when course label is shown', () => { + renderComponent(undefined, { text: '' }) + + expect(screen.getByText('Curso:').parentElement).toHaveClass('isCourse') + }) + + it('does not add isCourse class when course label is hidden for cv-events', () => { + renderComponent(undefined, { text: '', type: 'cv-events' }) + + expect(screen.getByText('Curso demo')).not.toHaveClass('isCourse') + }) }) diff --git a/src/organisms/Calendar/EventsList/EventsList.tsx b/src/organisms/Calendar/EventsList/EventsList.tsx index b95fd26e..d82cba34 100644 --- a/src/organisms/Calendar/EventsList/EventsList.tsx +++ b/src/organisms/Calendar/EventsList/EventsList.tsx @@ -43,6 +43,9 @@ export const EventsList = ({ const hoverBg = vars('colors-neutral-cultured2') ?? '#F8F8F8' const isCpr = type === 'cpr' const showEventLocation = !isCpr || Boolean(headquartersAddress) + const courseLabel = text || 'Curso' + const showCourseLabel = type !== 'cv-events' + const isCourse = showCourseLabel && courseLabel === 'Curso' const showEventDuration = ['online', 'in-person', 'cpr'].includes(type) && duration !== undefined && duration > 0 @@ -68,6 +71,9 @@ export const EventsList = ({ display: 'flex', gap: '4px', lineHeight: 'normal', + '&.isCourse': { + alignItems: 'self-start', + }, } const eventIconStyle = { @@ -134,9 +140,8 @@ export const EventsList = ({ {showCourse && !initOrEnd && ( - - {type === 'cv-events' ? <> : {text ? `${text}:` : 'Curso:'}}{' '} - {courseName} + + {showCourseLabel && {courseLabel}:} {courseName} )} From 888c95ae0c710226bd9b32610aa1a6581de14218 Mon Sep 17 00:00:00 2001 From: jonathan Date: Mon, 13 Jul 2026 14:47:18 -0400 Subject: [PATCH 2/2] =?UTF-8?q?test(calendar):=20ajusta=20validaci=C3=B3n?= =?UTF-8?q?=20de=20isCourse=20en=20EventsList?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/organisms/Calendar/EventsList/EventsList.test.tsx | 4 ++-- src/organisms/Calendar/EventsList/EventsList.tsx | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/organisms/Calendar/EventsList/EventsList.test.tsx b/src/organisms/Calendar/EventsList/EventsList.test.tsx index 8aef7c30..2d253c15 100644 --- a/src/organisms/Calendar/EventsList/EventsList.test.tsx +++ b/src/organisms/Calendar/EventsList/EventsList.test.tsx @@ -115,12 +115,12 @@ describe('EventsList', () => { it('adds isCourse class when course label is shown', () => { renderComponent(undefined, { text: '' }) - expect(screen.getByText('Curso:').parentElement).toHaveClass('isCourse') + expect(screen.getByTestId('event-course')).toHaveClass('isCourse') }) it('does not add isCourse class when course label is hidden for cv-events', () => { renderComponent(undefined, { text: '', type: 'cv-events' }) - expect(screen.getByText('Curso demo')).not.toHaveClass('isCourse') + expect(screen.getByTestId('event-course')).not.toHaveClass('isCourse') }) }) diff --git a/src/organisms/Calendar/EventsList/EventsList.tsx b/src/organisms/Calendar/EventsList/EventsList.tsx index d82cba34..dcbb7871 100644 --- a/src/organisms/Calendar/EventsList/EventsList.tsx +++ b/src/organisms/Calendar/EventsList/EventsList.tsx @@ -140,7 +140,12 @@ export const EventsList = ({ {showCourse && !initOrEnd && ( - + {showCourseLabel && {courseLabel}:} {courseName} )}