Advertisement
Guest User

Untitled

a guest
May 26th, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. import { GenderToTitlePipe } from './gender-to-title.pipe';
  2.  
  3. describe('GenderToTitlePipe', () => {
  4. let pipe: GenderToTitlePipe;
  5.  
  6. beforeAll(() => {
  7. pipe = new GenderToTitlePipe();
  8. });
  9.  
  10. it('create an instance', () => {
  11. const pipe = new GenderToTitlePipe();
  12. expect(pipe).toBeTruthy();
  13. });
  14.  
  15. it('Returns Mr. for male', () => {
  16. expect(pipe.transform('male'))
  17. .toEqual('Mr.');
  18. });
  19.  
  20. it('Returns Ms./Mrs. for female', () => {
  21. expect(pipe.transform('female'))
  22. .toEqual('Ms./Mrs.');
  23. });
  24.  
  25. it('Takes in capitalized gender Male and returns Mr.', () => {
  26. expect(pipe.transform('Male'))
  27. .toEqual('Mr.');
  28. });
  29. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement