formatters.spec.jsx 605 B

1234567891011121314151617181920212223
  1. import {userDisplayName} from 'app/utils/formatters';
  2. describe('formatters', function() {
  3. describe('userDisplayName', function() {
  4. it('should only show email, if name and email are the same', function() {
  5. expect(
  6. userDisplayName({
  7. name: 'foo@bar.com',
  8. email: 'foo@bar.com',
  9. })
  10. ).toEqual('foo@bar.com');
  11. });
  12. it('should show name + email, if name and email differ', function() {
  13. expect(
  14. userDisplayName({
  15. name: 'user',
  16. email: 'foo@bar.com',
  17. })
  18. ).toEqual('user (foo@bar.com)');
  19. });
  20. });
  21. });