Skip to content

Commit

Permalink
#81 Improve activity feed text
Browse files Browse the repository at this point in the history
  • Loading branch information
danielemery committed Jul 21, 2024
1 parent a14ef9d commit df1b55b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions src/activity/activity.service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('activity', () => {
date: new Date('2021-01-01'),
actionType: 'QUIZ_UPLOADED',
resourceId: 'fake-quiz-id',
text: 'New SHARK quiz from June 7, 2020 uploaded',
text: 'Uploaded a SHARK from June 7, 2020',
},
]);
});
Expand All @@ -54,7 +54,7 @@ describe('activity', () => {
date: new Date('2021-01-01'),
actionType: 'QUIZ_COMPLETED',
resourceId: 'fake-completion-id',
text: 'SHARK quiz from March 23, 2020 completed with score 12',
text: 'Scored 12 on the SHARK from March 23, 2020',
},
]);
});
Expand Down Expand Up @@ -116,31 +116,31 @@ describe('activity', () => {
date: new Date('2021-01-31'),
actionType: 'QUIZ_COMPLETED',
resourceId: 'fake-completion-id-one',
text: 'BRAINWAVES quiz from March 23, 2020 completed with score 19',
text: 'Scored 19 on the BRAINWAVES from March 23, 2020',
},
{
date: new Date('2021-01-21'),
actionType: 'QUIZ_UPLOADED',
resourceId: 'fake-quiz-id-one',
text: 'New BRAINWAVES quiz from June 7, 2020 uploaded',
text: 'Uploaded a BRAINWAVES from June 7, 2020',
},
{
date: new Date('2021-01-11'),
actionType: 'QUIZ_UPLOADED',
resourceId: 'fake-quiz-id-two',
text: 'New SHARK quiz from August 8, 2020 uploaded',
text: 'Uploaded a SHARK from August 8, 2020',
},
{
date: new Date('2021-01-05'),
actionType: 'QUIZ_COMPLETED',
resourceId: 'fake-completion-id-two',
text: 'SHARK quiz from March 23, 2020 completed with score 12',
text: 'Scored 12 on the SHARK from March 23, 2020',
},
{
date: new Date('2021-01-02'),
actionType: 'QUIZ_UPLOADED',
resourceId: 'fake-quiz-id-three',
text: 'New SHARK quiz from October 11, 2020 uploaded',
text: 'Uploaded a SHARK from October 11, 2020',
},
]);
});
Expand Down
6 changes: 3 additions & 3 deletions src/activity/activity.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@ export class ActivityService {
date: upload.uploadedAt,
actionType: 'QUIZ_UPLOADED',
resourceId: upload.id,
text: `New ${upload.type} quiz from ${quizDateFormatter.format(upload.date)} uploaded`,
text: `Uploaded a ${upload.type} from ${quizDateFormatter.format(upload.date)}`,
});
uploadIndex++;
} else {
results.push({
date: completion.completionDate,
actionType: 'QUIZ_COMPLETED',
resourceId: completion.id,
text: `${completion.quizType} quiz from ${quizDateFormatter.format(
text: `Scored ${completion.score} on the ${completion.quizType} from ${quizDateFormatter.format(
completion.quizDate,
)} completed with score ${completion.score}`,
)}`,
});
completionIndex++;
}
Expand Down

0 comments on commit df1b55b

Please sign in to comment.