equationSymbol.spec.tsx 736 B

123456789101112131415161718192021222324
  1. import {render, screen} from 'sentry-test/reactTestingLibrary';
  2. import {textWithMarkupMatcher} from 'sentry-test/utils';
  3. import {
  4. EquationSymbol,
  5. getEquationSymbol,
  6. } from 'sentry/components/metrics/equationSymbol';
  7. describe('getEquationSymbol', () => {
  8. it('should return the correct symbol', () => {
  9. expect(getEquationSymbol(0)).toBe('ƒ1');
  10. expect(getEquationSymbol(1)).toBe('ƒ2');
  11. });
  12. });
  13. describe('EquationSymbol', () => {
  14. it('renders', () => {
  15. render(<EquationSymbol equationId={0} />);
  16. expect(screen.getByText(textWithMarkupMatcher('ƒ1'))).toBeInTheDocument();
  17. render(<EquationSymbol equationId={5} />);
  18. expect(screen.getByText(textWithMarkupMatcher('ƒ6'))).toBeInTheDocument();
  19. });
  20. });