diff --git a/src/features/Dashboard/DashboardPage/_test_/index.test.jsx b/src/features/Dashboard/DashboardPage/_test_/index.test.jsx index 8ea95052..10a247df 100644 --- a/src/features/Dashboard/DashboardPage/_test_/index.test.jsx +++ b/src/features/Dashboard/DashboardPage/_test_/index.test.jsx @@ -64,7 +64,7 @@ describe('DashboardPage component', () => { ); test('renders components', () => { - const { getByText } = component; + const { getByText, getAllByText } = component; expect(getByText('This week')).toBeInTheDocument(); expect(getByText('Last month')).toBeInTheDocument(); @@ -73,8 +73,8 @@ describe('DashboardPage component', () => { expect(getByText('Classes scheduled')).toBeInTheDocument(); expect(getByText('License inventory')).toBeInTheDocument(); expect(getByText('Instructor assignment')).toBeInTheDocument(); - expect(getByText('ccx 1')).toBeInTheDocument(); - expect(getByText('Demo Course 1')).toBeInTheDocument(); + expect(getAllByText('ccx 1')[0]).toBeInTheDocument(); + expect(getAllByText('Demo Course 1')[0]).toBeInTheDocument(); expect(getByText('License Name 1')).toBeInTheDocument(); expect(getByText('Class schedule')).toBeInTheDocument(); expect(getByText('No classes scheduled at this time')).toBeInTheDocument(); diff --git a/src/features/Dashboard/DashboardPage/index.scss b/src/features/Dashboard/DashboardPage/index.scss index 3df3a8ba..ac8c6c7e 100644 --- a/src/features/Dashboard/DashboardPage/index.scss +++ b/src/features/Dashboard/DashboardPage/index.scss @@ -23,6 +23,10 @@ min-height: 426px; } +.responsive { + display: none; +} + .schedule-section { margin-bottom: 2rem; } @@ -53,4 +57,12 @@ .instructor-assign-section { min-height: 200px; } + + .no-responsive { + display: none; + } + + .responsive { + display: block; + } } diff --git a/src/features/Dashboard/InstructorAssignSection/ClassCard.jsx b/src/features/Dashboard/InstructorAssignSection/ClassCard.jsx index 90d114b9..ea82824d 100644 --- a/src/features/Dashboard/InstructorAssignSection/ClassCard.jsx +++ b/src/features/Dashboard/InstructorAssignSection/ClassCard.jsx @@ -7,6 +7,9 @@ import { Button } from 'react-paragon-topaz'; import { formatDateRange } from 'helpers'; import { useInstitutionIdQueryParam } from 'hooks'; +import EllipsisText from 'features/Dashboard/InstructorAssignSection/EllipsisText'; +import { textLength } from 'features/constants'; + import 'features/Dashboard/InstructorAssignSection/index.scss'; const ClassCard = ({ data }) => { @@ -19,8 +22,23 @@ const ClassCard = ({ data }) => { return (
-

{data?.className}

-

{data?.masterCourseName}

+
+ {data?.className.length > textLength ? ( + + ) : ( +

{data?.className}

+ )} + {data?.masterCourseName.length > textLength ? ( + + ) : ( +

{data?.masterCourseName}

+ )} +
+
+

{data?.className}

+

{data?.masterCourseName}

+
+

{formatDateRange(data.startDate, data?.endDate)}