Skip to content

Commit

Permalink
Merge branch '#564/feat/event-handler-for-csv' of github.com:ohtutrai…
Browse files Browse the repository at this point in the history
…ninghub/traininghub into #564/feat/event-handler-for-csv
  • Loading branch information
akskokki committed Apr 17, 2024
2 parents 00c7ef1 + c65cc09 commit 73b527e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions cypress/e2e/profileView.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ describe('Profile View', () => {
// close ended created courses dropdown
cy.getCy('listControls\\.endedCreated').click();
// trainer user is the creator of 2 upcoming courses and one ongoing course
cy.contains('Upcoming created courses (3)');
cy.contains('Created courses (3)');
cy.contains(testCourses[0].name).should('not.exist');
cy.contains(testCourses[1].name).contains('In Progress');
cy.contains(testCourses[2].name);
Expand Down Expand Up @@ -180,7 +180,7 @@ describe('Profile View', () => {
it('should not show upcoming created courses for admin', () => {
cy.getCy('myCoursesTab').click();
// admin isn't the creator of any courses
cy.contains('Upcoming created courses (0)');
cy.contains('Created courses (0)');
cy.contains('No courses to show.');
});
it('should not show ended created courses for admin', () => {
Expand Down Expand Up @@ -220,7 +220,7 @@ describe('Profile View', () => {
cy.visit('/profile/cluo35ozy000208jy18sdfe4a'); // trainer's user id
cy.contains('Tim Trainer');
cy.getCy('myCoursesTab').click();
cy.contains('Upcoming created courses (3)');
cy.contains('Created courses (3)');
cy.contains('Ended created courses (2)');
cy.contains('Course templates (0)');
});
Expand Down
4 changes: 2 additions & 2 deletions src/app/[lang]/locales/en/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@
"ProfileView": {
"header": {
"coursesInprogress": "Courses in progress",
"createdCourses": "Created courses",
"endedCourses": "Ended courses",
"endedCreatedCourses": "Ended created courses",
"templates": "Course templates",
"templatesAdmin": "All course templates",
"templatesTrainer": "My course templates",
"upcomingCourses": "Upcoming courses",
"upcomingCreatedCourses": "Upcoming created courses"
"upcomingCourses": "Upcoming courses"
},
"label": {
"Courses": "Courses",
Expand Down
4 changes: 2 additions & 2 deletions src/components/ProfileView/ProfileCourseList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export default function ProfileCourseList({
flexDirection: { xs: 'column', sm: 'row' },
}}
>
{ownProfile && (
{ownProfile && course.createdById === userId && (
<CreateSlackButton
lang={lang}
onclick={(
Expand All @@ -197,7 +197,7 @@ export default function ProfileCourseList({
buttonDisabled={Boolean(course.slackChannelId)}
/>
)}
{ownProfile && (
{ownProfile && course.createdById === userId && (
<CreateFeedbackButton
lang={lang}
onclick={(
Expand Down
4 changes: 2 additions & 2 deletions src/components/ProfileView/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ describe('ProfileView Tests', () => {

fireEvent.click(myCourses);
const upcomingCreatedCourses = screen.getByText(
'ProfileView.header.upcomingCreatedCourses (1)' // trainers created courses are in the past
'ProfileView.header.createdCourses (1)' // trainers created courses are in the past
);
const endedCreatedCourses = screen.getByText(
'ProfileView.header.endedCreatedCourses (1)'
Expand Down Expand Up @@ -309,7 +309,7 @@ describe('ProfileView Tests', () => {

fireEvent.click(myCourses);
const upcomingCreatedCourses = screen.getByText(
'ProfileView.header.upcomingCreatedCourses (1)'
'ProfileView.header.createdCourses (1)'
);
const endedCreatedCourses = screen.getByText(
'ProfileView.header.endedCreatedCourses (0)' // there are no ended courses that were created by the admin
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProfileView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export default function ProfileView({
<>
<ProfileCourseList
lang={lang}
headerText={t('ProfileView.header.upcomingCreatedCourses')}
headerText={t('ProfileView.header.createdCourses')}
courses={createdCourses.filter(
(createdCourse: Course) =>
createdCourse.startDate >= currentDate ||
Expand Down

0 comments on commit 73b527e

Please sign in to comment.