From df29d74527781be33d1224fbd53cdec66808aae2 Mon Sep 17 00:00:00 2001 From: kanhaiya Date: Sun, 12 Nov 2023 01:15:08 +0530 Subject: [PATCH] created a return button on event dashboard --- .../LeftDrawerEvent/LeftDrawerEvent.test.tsx | 19 ++++++++++++++++++- .../LeftDrawerEvent/LeftDrawerEvent.tsx | 14 ++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/components/LeftDrawerEvent/LeftDrawerEvent.test.tsx b/src/components/LeftDrawerEvent/LeftDrawerEvent.test.tsx index 0fabcd2c55..92d0ac32ad 100644 --- a/src/components/LeftDrawerEvent/LeftDrawerEvent.test.tsx +++ b/src/components/LeftDrawerEvent/LeftDrawerEvent.test.tsx @@ -18,7 +18,7 @@ const props: InterfaceLeftDrawerProps = { title: 'Test Event', description: 'Test Description', organization: { - _id: 'Test Organization', + _id: 'TestOrganization', }, }, hideDrawer: false, @@ -218,4 +218,21 @@ describe('Testing Left Drawer component for the Event Dashboard', () => { expect(truncatedEventTitle).toContain('...'); expect(truncatedEventDescription).toContain('...'); }); + test('Testing all events button', async () => { + localStorage.setItem('UserType', 'SUPERADMIN'); + render( + + + + + + + + ); + + userEvent.click(screen.getByTestId('allEventsBtn')); + expect(global.window.location.pathname).toBe( + `/orgevents/id=${props.event.organization._id}` + ); + }); }); diff --git a/src/components/LeftDrawerEvent/LeftDrawerEvent.tsx b/src/components/LeftDrawerEvent/LeftDrawerEvent.tsx index 2e3ac65cde..2d41b4503f 100644 --- a/src/components/LeftDrawerEvent/LeftDrawerEvent.tsx +++ b/src/components/LeftDrawerEvent/LeftDrawerEvent.tsx @@ -130,6 +130,20 @@ const leftDrawerEvent = ({ eventId={event._id} key={`${event?._id || 'loading'}Stats`} /> + {/* Profile Section & Logout Btn */}