diff --git a/src/components/EventListCard/EventListCard.module.css b/src/components/EventListCard/EventListCard.module.css
index 5b128d075d..2854738252 100644
--- a/src/components/EventListCard/EventListCard.module.css
+++ b/src/components/EventListCard/EventListCard.module.css
@@ -17,9 +17,24 @@
.cards a:hover {
color: black;
}
+.cards {
+ position: relative;
+ overflow: hidden;
+ transition: all 0.3s;
+}
.dispflex {
display: flex;
- justify-content: space-between;
+ height: 50px;
+ transition: transform 0.3s ease;
+ cursor: pointer;
+}
+.cards:hover {
+ transform: scale(2.5);
+ z-index: 5;
+}
+.cards:hover h2 {
+ font-size: 0.4vmax;
+ margin-bottom: 0;
}
.iconContainer {
display: flex;
diff --git a/src/components/EventListCard/EventListCard.test.tsx b/src/components/EventListCard/EventListCard.test.tsx
index ee48e2f871..61eaa4acb7 100644
--- a/src/components/EventListCard/EventListCard.test.tsx
+++ b/src/components/EventListCard/EventListCard.test.tsx
@@ -268,4 +268,44 @@ describe('Testing Event List Card', () => {
fireEvent.click(deleteBtn);
});
});
+
+ test('Should render truncated event details', async () => {
+ const longEventName =
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. A very long event name that exceeds 150 characters and needs to be truncated';
+ const longDescription =
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. A very long description that exceeds 150 characters and needs to be truncated';
+ const longEventNameLength = longEventName.length;
+ const longDescriptionLength = longDescription.length;
+ const truncatedEventName = longEventName.substring(0, 150) + '...';
+ const truncatedDescriptionName = longDescription.substring(0, 150) + '...';
+ render(
+
{t('eventTitle')}:{' '} - {props.eventName ? <>{props.eventName}> : <>Dogs Care>}{' '} + {props.eventName ? ( + <> + {props.eventName.length > 100 ? ( + <>{props.eventName.substring(0, 100)}...> + ) : ( + <>{props.eventName}> + )} + > + ) : ( + <>Dogs Care> + )}
@@ -177,7 +197,11 @@ function eventListCard(props: InterfaceEventListCardProps): JSX.Element {
{t('description')}:{' '} - {props.eventDescription} + + {props.eventDescription && props.eventDescription.length > 256 + ? props.eventDescription.substring(0, 256) + '...' + : props.eventDescription} +
{t('on')}: {props.regDate}
diff --git a/src/components/LeftDrawerEvent/LeftDrawerEvent.test.tsx b/src/components/LeftDrawerEvent/LeftDrawerEvent.test.tsx
index f6187ce9c6..0fabcd2c55 100644
--- a/src/components/LeftDrawerEvent/LeftDrawerEvent.test.tsx
+++ b/src/components/LeftDrawerEvent/LeftDrawerEvent.test.tsx
@@ -25,6 +25,20 @@ const props: InterfaceLeftDrawerProps = {
setHideDrawer: jest.fn(),
setShowAddEventProjectModal: jest.fn(),
};
+const props2: InterfaceLeftDrawerProps = {
+ event: {
+ _id: 'testEvent',
+ title: 'This is a very long event title that exceeds 20 characters',
+ description:
+ 'This is a very long event description that exceeds 30 characters. It contains more details about the event.',
+ organization: {
+ _id: 'Test Organization',
+ },
+ },
+ hideDrawer: false,
+ setHideDrawer: jest.fn(),
+ setShowAddEventProjectModal: jest.fn(),
+};
const mocks = [
{
@@ -184,4 +198,24 @@ describe('Testing Left Drawer component for the Event Dashboard', () => {
expect(localStorage.clear).toHaveBeenCalled();
expect(global.window.location.pathname).toBe('/');
});
+ test('Testing substring functionality in event title and description', async () => {
+ localStorage.setItem('UserType', 'SUPERADMIN');
+ render(
+