locale.spec.jsx 518 B

12345678910111213141516171819202122
  1. import {mountWithTheme} from 'sentry-test/enzyme';
  2. import {tct} from 'app/locale';
  3. describe('locale.gettextComponentTemplate', () => {
  4. it('should render two component templates inside the same parent', async () => {
  5. const wrapper = mountWithTheme(
  6. <div>
  7. {tct('1st: [one]', {
  8. one: 'one',
  9. })}
  10. {tct('2nd: [two]', {
  11. two: 'two',
  12. })}
  13. </div>
  14. );
  15. await tick();
  16. wrapper.update();
  17. expect(wrapper.text()).toBe('1st: one2nd: two');
  18. });
  19. });