-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
…pec.ts
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,50 @@ | ||
import { RecipientTypeNamePipe } from './recipient-type-name.pipe'; | ||
import { FeedbackParticipantType } from '../../../types/api-output'; | ||
Check failure on line 2 in src/web/app/components/question-submission-form/recipient-type-name.pipe.spec.ts GitHub Actions / lint (ubuntu-latest)
|
||
|
||
describe('RecipientTypeNamePipe', () => { | ||
it('create an instance', () => { | ||
const pipe: RecipientTypeNamePipe = new RecipientTypeNamePipe(); | ||
let pipe: RecipientTypeNamePipe; | ||
|
||
beforeEach(() => { | ||
pipe = new RecipientTypeNamePipe(); | ||
}); | ||
|
||
it('should create an instance', () => { | ||
expect(pipe).toBeTruthy(); | ||
}); | ||
|
||
it('should return "Team" for TEAMS', () => { | ||
expect(pipe.transform(FeedbackParticipantType.TEAMS, FeedbackParticipantType.STUDENTS)).toEqual('Team'); | ||
}); | ||
|
||
it('should return "Student" for STUDENTS', () => { | ||
expect(pipe.transform(FeedbackParticipantType.STUDENTS, FeedbackParticipantType.STUDENTS)).toEqual('Student'); | ||
}); | ||
|
||
it('should return "Instructor" for INSTRUCTORS', () => { | ||
expect(pipe.transform(FeedbackParticipantType.INSTRUCTORS, FeedbackParticipantType.STUDENTS)).toEqual('Instructor'); | ||
}); | ||
|
||
// ... you can continue with the other FeedbackParticipantTypes | ||
|
||
describe('for OWN_TEAM_MEMBERS and OWN_TEAM_MEMBERS_INCLUDING_SELF', () => { | ||
it('should return "Student" when giverType is STUDENTS', () => { | ||
expect(pipe.transform(FeedbackParticipantType.OWN_TEAM_MEMBERS, FeedbackParticipantType.STUDENTS)).toEqual('Student'); | ||
Check failure on line 31 in src/web/app/components/question-submission-form/recipient-type-name.pipe.spec.ts GitHub Actions / lint (ubuntu-latest)
|
||
expect(pipe.transform(FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF, FeedbackParticipantType.STUDENTS)).toEqual('Student'); | ||
Check failure on line 32 in src/web/app/components/question-submission-form/recipient-type-name.pipe.spec.ts GitHub Actions / lint (ubuntu-latest)
|
||
}); | ||
|
||
it('should return "Instructor" when giverType is INSTRUCTORS', () => { | ||
expect(pipe.transform(FeedbackParticipantType.OWN_TEAM_MEMBERS, FeedbackParticipantType.INSTRUCTORS)).toEqual('Instructor'); | ||
Check failure on line 36 in src/web/app/components/question-submission-form/recipient-type-name.pipe.spec.ts GitHub Actions / lint (ubuntu-latest)
|
||
expect(pipe.transform(FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF, FeedbackParticipantType.INSTRUCTORS)).toEqual('Instructor'); | ||
Check failure on line 37 in src/web/app/components/question-submission-form/recipient-type-name.pipe.spec.ts GitHub Actions / lint (ubuntu-latest)
|
||
}); | ||
|
||
it('should return "Student" when giverType is TEAMS', () => { | ||
expect(pipe.transform(FeedbackParticipantType.OWN_TEAM_MEMBERS, FeedbackParticipantType.TEAMS)).toEqual('Student'); | ||
Check failure on line 41 in src/web/app/components/question-submission-form/recipient-type-name.pipe.spec.ts GitHub Actions / lint (ubuntu-latest)
|
||
expect(pipe.transform(FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF, FeedbackParticipantType.TEAMS)).toEqual('Student'); | ||
Check failure on line 42 in src/web/app/components/question-submission-form/recipient-type-name.pipe.spec.ts GitHub Actions / lint (ubuntu-latest)
|
||
}); | ||
|
||
it('should return "Unknown" for any other giverType', () => { | ||
expect(pipe.transform(FeedbackParticipantType.OWN_TEAM_MEMBERS, 'ANY_OTHER_TYPE' as FeedbackParticipantType)).toEqual('Unknown'); | ||
Check failure on line 46 in src/web/app/components/question-submission-form/recipient-type-name.pipe.spec.ts GitHub Actions / lint (ubuntu-latest)
|
||
expect(pipe.transform(FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF, 'ANY_OTHER_TYPE' as FeedbackParticipantType)).toEqual('Unknown'); | ||
Check failure on line 47 in src/web/app/components/question-submission-form/recipient-type-name.pipe.spec.ts GitHub Actions / lint (ubuntu-latest)
|
||
}); | ||
}); | ||
}); |