diff --git a/src/components/LeftDrawerEvent/LeftDrawerEvent.test.tsx b/src/components/LeftDrawerEvent/LeftDrawerEvent.test.tsx index 889ba7fea6..eb4a449a67 100644 --- a/src/components/LeftDrawerEvent/LeftDrawerEvent.test.tsx +++ b/src/components/LeftDrawerEvent/LeftDrawerEvent.test.tsx @@ -17,7 +17,7 @@ const props: InterfaceLeftDrawerProps = { title: 'Test Event', description: 'Test Description', organization: { - _id: 'Test Organization', + _id: 'TestOrganization', }, }, hideDrawer: false, @@ -216,4 +216,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 5feb818a89..883ffc6f6e 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 */} diff --git a/src/components/Loader/Loader.test.tsx b/src/components/Loader/Loader.test.tsx index c182c73f4f..c512b480e3 100644 --- a/src/components/Loader/Loader.test.tsx +++ b/src/components/Loader/Loader.test.tsx @@ -1,16 +1,24 @@ import React from 'react'; import { render, screen } from '@testing-library/react'; -import { BrowserRouter } from 'react-router-dom'; - import Loader from './Loader'; describe('Testing Loader component', () => { test('Component should be rendered properly', () => { - render( - - - - ); + render(); + + expect(screen.getByTestId('spinner-wrapper')).toBeInTheDocument(); + expect(screen.getByTestId('spinner')).toBeInTheDocument(); + }); + + test('Component should render on custom sizes', () => { + render(); + + expect(screen.getByTestId('spinner-wrapper')).toBeInTheDocument(); + expect(screen.getByTestId('spinner')).toBeInTheDocument(); + }); + + test('Component should render with large size', () => { + render(); expect(screen.getByTestId('spinner-wrapper')).toBeInTheDocument(); expect(screen.getByTestId('spinner')).toBeInTheDocument();