splitDiff.stories.js 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. import SplitDiff from 'sentry/components/splitDiff';
  2. const base = `RangeError: Invalid array length
  3. at Constructor.render(./app/components/scoreBar.jsx:73:0)
  4. at ? (~/react/lib/ReactCompositeComponent.js:793:0)
  5. at measureLifeCyclePerf(~/react/lib/ReactCompositeComponent.js:74:0)
  6. at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext(~/react/lib/ReactCompositeComponent.js:792:0)
  7. at ReactCompositeComponentWrapper._renderValidatedComponent(~/react/lib/ReactCompositeComponent.js:819:0)
  8. at ReactCompositeComponentWrapper.performInitialMount(~/react/lib/ReactCompositeComponent.js:361:0)
  9. at ReactCompositeComponentWrapper.mountComponent(~/react/lib/ReactCompositeComponent.js:257:0)
  10. at Object.mountComponent(~/react/lib/ReactReconciler.js:47:0)
  11. at ReactDOMComponent.mountChildren(~/react/lib/ReactMultiChild.js:240:0)
  12. at ReactDOMComponent._createInitialChildren(~/react/lib/ReactDOMComponent.js:699:0)
  13. at ReactDOMComponent.mountComponent(~/react/lib/ReactDOMComponent.js:524:0)
  14. at Object.mountComponent(~/react/lib/ReactReconciler.js:47:0)
  15. at ReactCompositeComponentWrapper.performInitialMount(~/react/lib/ReactCompositeComponent.js:370:0)
  16. at ReactCompositeComponentWrapper.mountComponent(~/react/lib/ReactCompositeComponent.js:257:0)
  17. at Object.mountComponent(~/react/lib/ReactReconciler.js:47:0)
  18. at ReactDOMComponent.mountChildren(~/react/lib/ReactMultiChild.js:240:0)
  19. at ReactDOMComponent._createInitialChildren(~/react/lib/ReactDOMComponent.js:699:0)
  20. at ReactDOMComponent.mountComponent(~/react/lib/ReactDOMComponent.js:524:0)
  21. at Object.mountComponent(~/react/lib/ReactReconciler.js:47:0)
  22. at ReactDOMComponent.mountChildren(~/react/lib/ReactMultiChild.js:240:0)
  23. at ReactDOMComponent._createInitialChildren(~/react/lib/ReactDOMComponent.js:699:0)
  24. at ReactDOMComponent.mountComponent(~/react/lib/ReactDOMComponent.js:524:0)
  25. at Object.mountComponent(~/react/lib/ReactReconciler.js:47:0)
  26. at ReactDOMComponent.mountChildren(~/react/lib/ReactMultiChild.js:240:0)
  27. at ReactDOMComponent._createInitialChildren(~/react/lib/ReactDOMComponent.js:699:0)
  28. at ReactDOMComponent.mountComponent(~/react/lib/ReactDOMComponent.js:524:0)
  29. at Object.mountComponent(~/react/lib/ReactReconciler.js:47:0)
  30. at ReactCompositeComponentWrapper.performInitialMount(~/react/lib/ReactCompositeComponent.js:370:0)
  31. at ReactCompositeComponentWrapper.mountComponent(~/react/lib/ReactCompositeComponent.js:257:0)
  32. at Object.mountComponent(~/react/lib/ReactReconciler.js:47:0)
  33. at ReactCompositeComponentWrapper.performInitialMount(~/react/lib/ReactCompositeComponent.js:370:0)
  34. at ReactCompositeComponentWrapper.mountComponent(~/react/lib/ReactCompositeComponent.js:257:0)
  35. at Object.mountComponent(~/react/lib/ReactReconciler.js:47:0)
  36. at Object.updateChildren(~/react/lib/ReactChildReconciler.js:122:0)
  37. at ReactDOMComponent._reconcilerUpdateChildren(~/react/lib/ReactMultiChild.js:210:0)
  38. at ReactDOMComponent._updateChildren(~/react/lib/ReactMultiChild.js:314:0)
  39. at ReactDOMComponent.updateChildren(~/react/lib/ReactMultiChild.js:301:0)
  40. at ReactDOMComponent._updateDOMChildren(~/react/lib/ReactDOMComponent.js:942:0)
  41. at ReactDOMComponent.updateComponent(~/react/lib/ReactDOMComponent.js:760:0)
  42. at ReactDOMComponent.receiveComponent(~/react/lib/ReactDOMComponent.js:718:0)
  43. at Object.receiveComponent(~/react/lib/ReactReconciler.js:126:0)
  44. at Object.updateChildren(~/react/lib/ReactChildReconciler.js:110:0)
  45. at ReactDOMComponent._reconcilerUpdateChildren(~/react/lib/ReactMultiChild.js:210:0)
  46. at ReactDOMComponent._updateChildren(~/react/lib/ReactMultiChild.js:314:0)
  47. at ReactDOMComponent.updateChildren(~/react/lib/ReactMultiChild.js:301:0)
  48. at ReactDOMComponent._updateDOMChildren(~/react/lib/ReactDOMComponent.js:942:0)
  49. at ReactDOMComponent.updateComponent(~/react/lib/ReactDOMComponent.js:760:0)
  50. at ReactDOMComponent.receiveComponent(~/react/lib/ReactDOMComponent.js:718:0)
  51. at Object.receiveComponent(~/react/lib/ReactReconciler.js:126:0)
  52. at ReactCompositeComponentWrapper._updateRenderedComponent(~/react/lib/ReactCompositeComponent.js:751:0)`;
  53. const target = `TypeError: Cannot read property 'id' of undefined
  54. at StreamGroupHeader.render(./app/components/stream/StreamGroupHeader.jsx:54:0)
  55. at ? (~/react/lib/ReactCompositeComponent.js:793:0)
  56. at measureLifeCyclePerf(~/react/lib/ReactCompositeComponent.js:74:0)
  57. at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext(~/react/lib/ReactCompositeComponent.js:792:0)
  58. at ReactCompositeComponentWrapper._renderValidatedComponent(~/react/lib/ReactCompositeComponent.js:819:0)
  59. at ReactCompositeComponentWrapper.performInitialMount(~/react/lib/ReactCompositeComponent.js:361:0)
  60. at ReactCompositeComponentWrapper.mountComponent(~/react/lib/ReactCompositeComponent.js:257:0)
  61. at Object.mountComponent(~/react/lib/ReactReconciler.js:47:0)
  62. at ReactDOMComponent.mountChildren(~/react/lib/ReactMultiChild.js:240:0)
  63. at ReactDOMComponent._createInitialChildren(~/react/lib/ReactDOMComponent.js:699:0)
  64. at ReactDOMComponent.mountComponent(~/react/lib/ReactDOMComponent.js:524:0)
  65. at Object.mountComponent(~/react/lib/ReactReconciler.js:47:0)
  66. at ReactDOMComponent.mountChildren(~/react/lib/ReactMultiChild.js:240:0)
  67. at ReactDOMComponent._createInitialChildren(~/react/lib/ReactDOMComponent.js:699:0)
  68. at ReactDOMComponent.mountComponent(~/react/lib/ReactDOMComponent.js:524:0)
  69. at Object.mountComponent(~/react/lib/ReactReconciler.js:47:0)
  70. at ReactCompositeComponentWrapper.performInitialMount(~/react/lib/ReactCompositeComponent.js:370:0)
  71. at ReactCompositeComponentWrapper.mountComponent(~/react/lib/ReactCompositeComponent.js:257:0)
  72. at Object.mountComponent(~/react/lib/ReactReconciler.js:47:0)
  73. at ReactDOMComponent.mountChildren(~/react/lib/ReactMultiChild.js:240:0)
  74. at ReactDOMComponent._createInitialChildren(~/react/lib/ReactDOMComponent.js:699:0)
  75. at ReactDOMComponent.mountComponent(~/react/lib/ReactDOMComponent.js:524:0)
  76. at Object.mountComponent(~/react/lib/ReactReconciler.js:47:0)
  77. at Object.updateChildren(~/react/lib/ReactChildReconciler.js:122:0)
  78. at ReactDOMComponent._reconcilerUpdateChildren(~/react/lib/ReactMultiChild.js:210:0)
  79. at ReactDOMComponent._updateChildren(~/react/lib/ReactMultiChild.js:314:0)
  80. at ReactDOMComponent.updateChildren(~/react/lib/ReactMultiChild.js:301:0)
  81. at ReactDOMComponent._updateDOMChildren(~/react/lib/ReactDOMComponent.js:942:0)
  82. at ReactDOMComponent.updateComponent(~/react/lib/ReactDOMComponent.js:760:0)
  83. at ReactDOMComponent.receiveComponent(~/react/lib/ReactDOMComponent.js:718:0)
  84. at Object.receiveComponent(~/react/lib/ReactReconciler.js:126:0)
  85. at Object.updateChildren(~/react/lib/ReactChildReconciler.js:110:0)
  86. at ReactDOMComponent._reconcilerUpdateChildren(~/react/lib/ReactMultiChild.js:210:0)
  87. at ReactDOMComponent._updateChildren(~/react/lib/ReactMultiChild.js:314:0)
  88. at ReactDOMComponent.updateChildren(~/react/lib/ReactMultiChild.js:301:0)
  89. at ReactDOMComponent._updateDOMChildren(~/react/lib/ReactDOMComponent.js:942:0)
  90. at ReactDOMComponent.updateComponent(~/react/lib/ReactDOMComponent.js:760:0)
  91. at ReactDOMComponent.receiveComponent(~/react/lib/ReactDOMComponent.js:718:0)
  92. at Object.receiveComponent(~/react/lib/ReactReconciler.js:126:0)
  93. at Object.updateChildren(~/react/lib/ReactChildReconciler.js:110:0)
  94. at ReactDOMComponent._reconcilerUpdateChildren(~/react/lib/ReactMultiChild.js:210:0)
  95. at ReactDOMComponent._updateChildren(~/react/lib/ReactMultiChild.js:314:0)
  96. at ReactDOMComponent.updateChildren(~/react/lib/ReactMultiChild.js:301:0)
  97. at ReactDOMComponent._updateDOMChildren(~/react/lib/ReactDOMComponent.js:942:0)
  98. at ReactDOMComponent.updateComponent(~/react/lib/ReactDOMComponent.js:760:0)
  99. at ReactDOMComponent.receiveComponent(~/react/lib/ReactDOMComponent.js:718:0)
  100. at Object.receiveComponent(~/react/lib/ReactReconciler.js:126:0)
  101. at ReactCompositeComponentWrapper._updateRenderedComponent(~/react/lib/ReactCompositeComponent.js:751:0)
  102. at ReactCompositeComponentWrapper._performComponentUpdate(~/react/lib/ReactCompositeComponent.js:721:0)
  103. at ReactCompositeComponentWrapper.updateComponent(~/react/lib/ReactCompositeComponent.js:642:0)`;
  104. export default {
  105. title: 'Components/Data Visualization/Misc/Split Diff',
  106. component: SplitDiff,
  107. argTypes: {
  108. type: {
  109. control: {
  110. type: 'select',
  111. options: ['chars', 'words', 'lines'],
  112. },
  113. },
  114. },
  115. };
  116. export const _SplitDiff = ({...args}) => (
  117. <SplitDiff base={base} target={target} {...args} />
  118. );
  119. _SplitDiff.storyName = 'Split Diff';
  120. _SplitDiff.parameters = {
  121. docs: {
  122. description: {
  123. story: 'Diffs two strings, split by newlines if present',
  124. },
  125. },
  126. };