index.spec.tsx 966 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import {render, screen} from 'sentry-test/reactTestingLibrary';
  2. import {MemoryInfoEventContext} from 'sentry/components/events/contexts/memoryInfo';
  3. import {MemoryInfoContext} from 'sentry/types';
  4. export const memoryInfoMockData: MemoryInfoContext = {
  5. allocated_bytes: 9614872,
  6. compacted: false,
  7. concurrent: false,
  8. finalization_pending_count: 0,
  9. high_memory_load_threshold_bytes: 30923764531,
  10. pause_durations: [0, 0],
  11. total_available_memory_bytes: 34359738368,
  12. type: 'memory_info',
  13. };
  14. export const memoryInfoMetaMockData = {
  15. '': {
  16. rem: [['organization:0', 'x']],
  17. },
  18. };
  19. const event = {
  20. ...TestStubs.Event(),
  21. _meta: {
  22. contexts: {
  23. memory_info: memoryInfoMetaMockData,
  24. },
  25. },
  26. };
  27. describe('memory info event context', function () {
  28. it('display redacted data', function () {
  29. render(<MemoryInfoEventContext event={event} data={null} />);
  30. expect(screen.queryByText('Memory Info')).not.toBeInTheDocument();
  31. });
  32. });