Skip to content

Commit

Permalink
Add tests for visibility-messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mingyang143 committed Dec 13, 2024
1 parent 6f82bfb commit 275c6d5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,3 @@ describe('VisibilityCapabilityPipe', () => {
});

});

Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
import {VisibilityEntityNamePipe} from './visibility-entity-name.pipe';
import { VisibilityEntityNamePipe } from './visibility-entity-name.pipe';
import {
FeedbackParticipantType,
FeedbackVisibilityType,
NumberOfEntitiesToGiveFeedbackToSetting
} from "../../../types/api-output";
NumberOfEntitiesToGiveFeedbackToSetting,
} from '../../../types/api-output';

describe('VisibilityEntityNamePipe', () => {
it('create an instance', () => {
const pipe: VisibilityEntityNamePipe = new VisibilityEntityNamePipe();
expect(pipe).toBeTruthy();
});

it('should return the correct entity name when the visibility type is RECIPIENT and recipient type is ' +
'INSTRUCTORS ', () => {
it('should return the correct entity name when the visibility type is RECIPIENT and recipient type is '
+ 'INSTRUCTORS ', () => {
const pipe: VisibilityEntityNamePipe = new VisibilityEntityNamePipe();
const result = pipe.transform(FeedbackVisibilityType.RECIPIENT, FeedbackParticipantType.INSTRUCTORS);
expect(result).toBe('The receiving instructor');
});

it('should return the correct entity name when the visibility type is RECIPIENT and recipient type is ' +
'STUDENTS', () => {
it('should return the correct entity name when the visibility type is RECIPIENT and recipient type is '
+ 'STUDENTS', () => {
const pipe: VisibilityEntityNamePipe = new VisibilityEntityNamePipe();
const result = pipe.transform(FeedbackVisibilityType.RECIPIENT, FeedbackParticipantType.STUDENTS);
expect(result).toBe('The receiving student');
});

it('should return the correct entity name when the visibility type is RECIPIENT and recipient type is ' +
'TEAMS', () => {
it('should return the correct entity name when the visibility type is RECIPIENT and recipient type is '
+ 'TEAMS', () => {
const pipe: VisibilityEntityNamePipe = new VisibilityEntityNamePipe();
const result = pipe.transform(FeedbackVisibilityType.RECIPIENT, FeedbackParticipantType.TEAMS);
expect(result).toBe('The receiving team');
});

it('should return the correct entity name when the visibility type is RECIPIENT and recipient type is ' +
'NONE', () => {
it('should return the correct entity name when the visibility type is RECIPIENT and recipient type is '
+ 'NONE', () => {
const pipe: VisibilityEntityNamePipe = new VisibilityEntityNamePipe();
const result = pipe.transform(FeedbackVisibilityType.RECIPIENT, FeedbackParticipantType.NONE);
expect(result).toBe('unknown');
Expand Down Expand Up @@ -63,8 +63,8 @@ describe('VisibilityEntityNamePipe', () => {
expect(result).toBe("The recipient's team members");
});

it('should return plural form of entity name when the visibility type is RECIPIENT and the number of entities ' +
'to give feedback to UNLIMITED', () => {
it('should return plural form of entity name when the visibility type is RECIPIENT and the number of entities '
+ 'to give feedback to UNLIMITED', () => {
const pipe: VisibilityEntityNamePipe = new VisibilityEntityNamePipe();
const result = pipe.transform(FeedbackVisibilityType.RECIPIENT, FeedbackParticipantType.STUDENTS,
NumberOfEntitiesToGiveFeedbackToSetting.UNLIMITED);
Expand Down

0 comments on commit 275c6d5

Please sign in to comment.