handleError.spec.tsx 611 B

12345678910111213141516171819
  1. import handleError from 'sentry/views/settings/components/dataScrubbing/modals/handleError';
  2. describe('Data Scrubbing handleError', function () {
  3. it.each([
  4. {
  5. message: 'Compiled regex exceeds size limit of 262144 bytes.',
  6. name: 'regex too long',
  7. },
  8. ])('recognizes errors "$name"', function ({message}) {
  9. const rawError = {
  10. responseJSON: {
  11. relayPiiConfig: [message],
  12. },
  13. };
  14. const error = handleError(rawError);
  15. // check we don't get the default error message
  16. expect(error.message.toLowerCase().startsWith('an unknown error')).toBeFalsy();
  17. });
  18. });