Skip to content

Commit

Permalink
Prefix course titles in dashboard's course section
Browse files Browse the repository at this point in the history
  • Loading branch information
acelaya committed Jul 25, 2024
1 parent bf6d736 commit 529d96c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export default function CourseActivity() {
}),
);

const title = `Course: ${course.data?.title}`;
const rows: AssignmentsTableRow[] = useMemo(
() =>
(assignments.data?.assignments ?? []).map(
Expand All @@ -60,12 +61,12 @@ export default function CourseActivity() {
<h2 className="text-lg text-brand font-semibold" data-testid="title">
{course.isLoading && 'Loading...'}
{course.error && 'Could not load course title'}
{course.data && course.data.title}
{course.data && title}
</h2>
</div>
<OrderableActivityTable
loading={assignments.isLoading}
title={course.data?.title ?? 'Loading...'}
title={course.isLoading ? 'Loading...' : title}
emptyMessage={
assignments.error
? 'Could not load assignments'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ describe('CourseActivity', () => {
const wrapper = createComponent();
const titleElement = wrapper.find('[data-testid="title"]');
const tableElement = wrapper.find('OrderableActivityTable');
const expectedTitle = 'The title';
const expectedTitle = 'Course: The title';

assert.equal(titleElement.text(), expectedTitle);
assert.equal(tableElement.prop('title'), expectedTitle);
Expand Down

0 comments on commit 529d96c

Please sign in to comment.