import { replaceI18nVariablesInString } from '.';

describe('RichTextEditor i18n', () => {
  it('replaces variable parts of a translation string correctly', async () => {
    expect(replaceI18nVariablesInString('Hi {{name}}!', 'you')).toBe('Hi you!');
    expect(replaceI18nVariablesInString('Hi {{whatever-goes here}}!', 'you')).toBe('Hi you!');
    expect(replaceI18nVariablesInString('It can be replace {{name}} many times {{name}}', 'you')).toBe(
      'It can be replace you many times you',
    );
    expect(replaceI18nVariablesInString('It needs correct formatting {name}}', 'you')).toBe(
      'It needs correct formatting {name}}',
    );
  });
});
