Skip to content

The open alternative to Salesforce, designed for AI.

752 B
Raw Blame
import { isValidAgentMessageReactionEmoji } from '../is-valid-agent-message-reaction-emoji.util';

describe('isValidAgentMessageReactionEmoji', () => {
  it.each(['πŸ‘', '❀️', 'πŸŽ‰', 'πŸ‘πŸ½', 'πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦', 'πŸ³οΈβ€πŸŒˆ', 'πŸ‡«πŸ‡·', '1️⃣'])(
    'should accept "%s"',
    (emoji) => {
      expect(isValidAgentMessageReactionEmoji(emoji)).toBe(true);
    },
  );

  it.each([
    ['an empty string', ''],
    ['plain text', 'ok'],
    ['a digit', '1'],
    ['an emoji followed by a space', 'πŸ‘ '],
    ['two emojis split by a newline', 'πŸ‘\nπŸŽ‰'],
    ['over 32 characters', 'πŸ‘'.repeat(17)],
  ])('should reject %s', (_label, emoji) => {
    expect(isValidAgentMessageReactionEmoji(emoji)).toBe(false);
  });
});