You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

HotspotList-test.tsx.snap 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632
  1. // Jest Snapshot v1, https://goo.gl/fbAQLP
  2. exports[`should render correctly 1`] = `
  3. <div
  4. className="huge-spacer-bottom"
  5. >
  6. <h1
  7. className="hotspot-list-header bordered-bottom"
  8. >
  9. <SecurityHotspotIcon
  10. className="spacer-right"
  11. />
  12. hotspots.list_title.TO_REVIEW.0
  13. </h1>
  14. <ul
  15. className="big-spacer-bottom big-spacer-top"
  16. />
  17. <ListFooter
  18. count={0}
  19. loadMore={[MockFunction]}
  20. loading={false}
  21. total={0}
  22. />
  23. </div>
  24. `;
  25. exports[`should render correctly 2`] = `
  26. <div
  27. className="huge-spacer-bottom"
  28. >
  29. <h1
  30. className="hotspot-list-header bordered-bottom"
  31. >
  32. <SecurityHotspotIcon
  33. className="spacer-right"
  34. />
  35. hotspots.list_title.TO_REVIEW.0
  36. </h1>
  37. <ul
  38. className="big-spacer-bottom big-spacer-top"
  39. />
  40. <ListFooter
  41. count={0}
  42. loading={true}
  43. total={0}
  44. />
  45. </div>
  46. `;
  47. exports[`should render correctly when the list of hotspot is static 1`] = `
  48. <div
  49. className="huge-spacer-bottom"
  50. >
  51. <h1
  52. className="hotspot-list-header bordered-bottom"
  53. >
  54. <SecurityHotspotIcon
  55. className="spacer-right"
  56. />
  57. hotspots.list_title.0
  58. </h1>
  59. <ul
  60. className="big-spacer-bottom big-spacer-top"
  61. />
  62. <ListFooter
  63. count={0}
  64. loadMore={[MockFunction]}
  65. loading={false}
  66. total={0}
  67. />
  68. </div>
  69. `;
  70. exports[`should render correctly with hotspots: no pagination 1`] = `
  71. <div
  72. className="huge-spacer-bottom"
  73. >
  74. <h1
  75. className="hotspot-list-header bordered-bottom"
  76. >
  77. <SecurityHotspotIcon
  78. className="spacer-right"
  79. />
  80. hotspots.list_title.TO_REVIEW.5
  81. </h1>
  82. <ul
  83. className="big-spacer-bottom big-spacer-top"
  84. >
  85. <li
  86. className="big-spacer-bottom"
  87. key="HIGH"
  88. >
  89. <div
  90. className="hotspot-risk-header little-spacer-left spacer-top spacer-bottom"
  91. >
  92. <span>
  93. hotspots.risk_exposure
  94. :
  95. </span>
  96. <div
  97. className="hotspot-risk-badge spacer-left HIGH"
  98. >
  99. risk_exposure.HIGH
  100. </div>
  101. </div>
  102. <ul>
  103. <li
  104. className="spacer-bottom"
  105. key="cat1"
  106. >
  107. <HotspotCategory
  108. categoryKey="cat1"
  109. hotspots={
  110. Array [
  111. Object {
  112. "author": "Developer 1",
  113. "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
  114. "creationDate": "2013-05-13T17:55:39+0200",
  115. "key": "h2",
  116. "line": 81,
  117. "message": "'3' is a magic number.",
  118. "project": "com.github.kevinsawicki:http-request",
  119. "resolution": undefined,
  120. "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
  121. "securityCategory": "cat1",
  122. "status": "TO_REVIEW",
  123. "updateDate": "2013-05-13T17:55:39+0200",
  124. "vulnerabilityProbability": "HIGH",
  125. },
  126. ]
  127. }
  128. isLastAndIncomplete={false}
  129. onHotspotClick={[MockFunction]}
  130. onLocationClick={[MockFunction]}
  131. onScroll={[MockFunction]}
  132. onToggleExpand={[Function]}
  133. selectedHotspot={
  134. Object {
  135. "author": "Developer 1",
  136. "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
  137. "creationDate": "2013-05-13T17:55:39+0200",
  138. "key": "h2",
  139. "line": 81,
  140. "message": "'3' is a magic number.",
  141. "project": "com.github.kevinsawicki:http-request",
  142. "resolution": undefined,
  143. "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
  144. "securityCategory": "command-injection",
  145. "status": "TO_REVIEW",
  146. "updateDate": "2013-05-13T17:55:39+0200",
  147. "vulnerabilityProbability": "HIGH",
  148. }
  149. }
  150. title="cat1"
  151. />
  152. </li>
  153. <li
  154. className="spacer-bottom"
  155. key="cat2"
  156. >
  157. <HotspotCategory
  158. categoryKey="cat2"
  159. hotspots={
  160. Array [
  161. Object {
  162. "author": "Developer 1",
  163. "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
  164. "creationDate": "2013-05-13T17:55:39+0200",
  165. "key": "h1",
  166. "line": 81,
  167. "message": "'3' is a magic number.",
  168. "project": "com.github.kevinsawicki:http-request",
  169. "resolution": undefined,
  170. "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
  171. "securityCategory": "cat2",
  172. "status": "TO_REVIEW",
  173. "updateDate": "2013-05-13T17:55:39+0200",
  174. "vulnerabilityProbability": "HIGH",
  175. },
  176. ]
  177. }
  178. isLastAndIncomplete={false}
  179. onHotspotClick={[MockFunction]}
  180. onLocationClick={[MockFunction]}
  181. onScroll={[MockFunction]}
  182. onToggleExpand={[Function]}
  183. selectedHotspot={
  184. Object {
  185. "author": "Developer 1",
  186. "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
  187. "creationDate": "2013-05-13T17:55:39+0200",
  188. "key": "h2",
  189. "line": 81,
  190. "message": "'3' is a magic number.",
  191. "project": "com.github.kevinsawicki:http-request",
  192. "resolution": undefined,
  193. "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
  194. "securityCategory": "command-injection",
  195. "status": "TO_REVIEW",
  196. "updateDate": "2013-05-13T17:55:39+0200",
  197. "vulnerabilityProbability": "HIGH",
  198. }
  199. }
  200. title="cat2"
  201. />
  202. </li>
  203. </ul>
  204. </li>
  205. <li
  206. className="big-spacer-bottom"
  207. key="MEDIUM"
  208. >
  209. <div
  210. className="hotspot-risk-header little-spacer-left spacer-top spacer-bottom"
  211. >
  212. <span>
  213. hotspots.risk_exposure
  214. :
  215. </span>
  216. <div
  217. className="hotspot-risk-badge spacer-left MEDIUM"
  218. >
  219. risk_exposure.MEDIUM
  220. </div>
  221. </div>
  222. <ul>
  223. <li
  224. className="spacer-bottom"
  225. key="cat1"
  226. >
  227. <HotspotCategory
  228. categoryKey="cat1"
  229. hotspots={
  230. Array [
  231. Object {
  232. "author": "Developer 1",
  233. "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
  234. "creationDate": "2013-05-13T17:55:39+0200",
  235. "key": "h3",
  236. "line": 81,
  237. "message": "'3' is a magic number.",
  238. "project": "com.github.kevinsawicki:http-request",
  239. "resolution": undefined,
  240. "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
  241. "securityCategory": "cat1",
  242. "status": "TO_REVIEW",
  243. "updateDate": "2013-05-13T17:55:39+0200",
  244. "vulnerabilityProbability": "MEDIUM",
  245. },
  246. Object {
  247. "author": "Developer 1",
  248. "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
  249. "creationDate": "2013-05-13T17:55:39+0200",
  250. "key": "h4",
  251. "line": 81,
  252. "message": "'3' is a magic number.",
  253. "project": "com.github.kevinsawicki:http-request",
  254. "resolution": undefined,
  255. "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
  256. "securityCategory": "cat1",
  257. "status": "TO_REVIEW",
  258. "updateDate": "2013-05-13T17:55:39+0200",
  259. "vulnerabilityProbability": "MEDIUM",
  260. },
  261. ]
  262. }
  263. isLastAndIncomplete={false}
  264. onHotspotClick={[MockFunction]}
  265. onLocationClick={[MockFunction]}
  266. onScroll={[MockFunction]}
  267. onToggleExpand={[Function]}
  268. selectedHotspot={
  269. Object {
  270. "author": "Developer 1",
  271. "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
  272. "creationDate": "2013-05-13T17:55:39+0200",
  273. "key": "h2",
  274. "line": 81,
  275. "message": "'3' is a magic number.",
  276. "project": "com.github.kevinsawicki:http-request",
  277. "resolution": undefined,
  278. "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
  279. "securityCategory": "command-injection",
  280. "status": "TO_REVIEW",
  281. "updateDate": "2013-05-13T17:55:39+0200",
  282. "vulnerabilityProbability": "HIGH",
  283. }
  284. }
  285. title="cat1"
  286. />
  287. </li>
  288. <li
  289. className="spacer-bottom"
  290. key="cat2"
  291. >
  292. <HotspotCategory
  293. categoryKey="cat2"
  294. hotspots={
  295. Array [
  296. Object {
  297. "author": "Developer 1",
  298. "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
  299. "creationDate": "2013-05-13T17:55:39+0200",
  300. "key": "h5",
  301. "line": 81,
  302. "message": "'3' is a magic number.",
  303. "project": "com.github.kevinsawicki:http-request",
  304. "resolution": undefined,
  305. "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
  306. "securityCategory": "cat2",
  307. "status": "TO_REVIEW",
  308. "updateDate": "2013-05-13T17:55:39+0200",
  309. "vulnerabilityProbability": "MEDIUM",
  310. },
  311. ]
  312. }
  313. isLastAndIncomplete={false}
  314. onHotspotClick={[MockFunction]}
  315. onLocationClick={[MockFunction]}
  316. onScroll={[MockFunction]}
  317. onToggleExpand={[Function]}
  318. selectedHotspot={
  319. Object {
  320. "author": "Developer 1",
  321. "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
  322. "creationDate": "2013-05-13T17:55:39+0200",
  323. "key": "h2",
  324. "line": 81,
  325. "message": "'3' is a magic number.",
  326. "project": "com.github.kevinsawicki:http-request",
  327. "resolution": undefined,
  328. "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
  329. "securityCategory": "command-injection",
  330. "status": "TO_REVIEW",
  331. "updateDate": "2013-05-13T17:55:39+0200",
  332. "vulnerabilityProbability": "HIGH",
  333. }
  334. }
  335. title="cat2"
  336. />
  337. </li>
  338. </ul>
  339. </li>
  340. </ul>
  341. <ListFooter
  342. count={5}
  343. loadMore={[MockFunction]}
  344. loading={false}
  345. total={5}
  346. />
  347. </div>
  348. `;
  349. exports[`should render correctly with hotspots: pagination 1`] = `
  350. <div
  351. className="huge-spacer-bottom"
  352. >
  353. <h1
  354. className="hotspot-list-header bordered-bottom"
  355. >
  356. <SecurityHotspotIcon
  357. className="spacer-right"
  358. />
  359. hotspots.list_title.TO_REVIEW.7
  360. </h1>
  361. <ul
  362. className="big-spacer-bottom big-spacer-top"
  363. >
  364. <li
  365. className="big-spacer-bottom"
  366. key="HIGH"
  367. >
  368. <div
  369. className="hotspot-risk-header little-spacer-left spacer-top spacer-bottom"
  370. >
  371. <span>
  372. hotspots.risk_exposure
  373. :
  374. </span>
  375. <div
  376. className="hotspot-risk-badge spacer-left HIGH"
  377. >
  378. risk_exposure.HIGH
  379. </div>
  380. </div>
  381. <ul>
  382. <li
  383. className="spacer-bottom"
  384. key="cat1"
  385. >
  386. <HotspotCategory
  387. categoryKey="cat1"
  388. hotspots={
  389. Array [
  390. Object {
  391. "author": "Developer 1",
  392. "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
  393. "creationDate": "2013-05-13T17:55:39+0200",
  394. "key": "h2",
  395. "line": 81,
  396. "message": "'3' is a magic number.",
  397. "project": "com.github.kevinsawicki:http-request",
  398. "resolution": undefined,
  399. "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
  400. "securityCategory": "cat1",
  401. "status": "TO_REVIEW",
  402. "updateDate": "2013-05-13T17:55:39+0200",
  403. "vulnerabilityProbability": "HIGH",
  404. },
  405. ]
  406. }
  407. isLastAndIncomplete={false}
  408. onHotspotClick={[MockFunction]}
  409. onLocationClick={[MockFunction]}
  410. onScroll={[MockFunction]}
  411. onToggleExpand={[Function]}
  412. selectedHotspot={
  413. Object {
  414. "author": "Developer 1",
  415. "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
  416. "creationDate": "2013-05-13T17:55:39+0200",
  417. "key": "h2",
  418. "line": 81,
  419. "message": "'3' is a magic number.",
  420. "project": "com.github.kevinsawicki:http-request",
  421. "resolution": undefined,
  422. "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
  423. "securityCategory": "command-injection",
  424. "status": "TO_REVIEW",
  425. "updateDate": "2013-05-13T17:55:39+0200",
  426. "vulnerabilityProbability": "HIGH",
  427. }
  428. }
  429. title="cat1"
  430. />
  431. </li>
  432. <li
  433. className="spacer-bottom"
  434. key="cat2"
  435. >
  436. <HotspotCategory
  437. categoryKey="cat2"
  438. hotspots={
  439. Array [
  440. Object {
  441. "author": "Developer 1",
  442. "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
  443. "creationDate": "2013-05-13T17:55:39+0200",
  444. "key": "h1",
  445. "line": 81,
  446. "message": "'3' is a magic number.",
  447. "project": "com.github.kevinsawicki:http-request",
  448. "resolution": undefined,
  449. "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
  450. "securityCategory": "cat2",
  451. "status": "TO_REVIEW",
  452. "updateDate": "2013-05-13T17:55:39+0200",
  453. "vulnerabilityProbability": "HIGH",
  454. },
  455. ]
  456. }
  457. isLastAndIncomplete={false}
  458. onHotspotClick={[MockFunction]}
  459. onLocationClick={[MockFunction]}
  460. onScroll={[MockFunction]}
  461. onToggleExpand={[Function]}
  462. selectedHotspot={
  463. Object {
  464. "author": "Developer 1",
  465. "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
  466. "creationDate": "2013-05-13T17:55:39+0200",
  467. "key": "h2",
  468. "line": 81,
  469. "message": "'3' is a magic number.",
  470. "project": "com.github.kevinsawicki:http-request",
  471. "resolution": undefined,
  472. "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
  473. "securityCategory": "command-injection",
  474. "status": "TO_REVIEW",
  475. "updateDate": "2013-05-13T17:55:39+0200",
  476. "vulnerabilityProbability": "HIGH",
  477. }
  478. }
  479. title="cat2"
  480. />
  481. </li>
  482. </ul>
  483. </li>
  484. <li
  485. className="big-spacer-bottom"
  486. key="MEDIUM"
  487. >
  488. <div
  489. className="hotspot-risk-header little-spacer-left spacer-top spacer-bottom"
  490. >
  491. <span>
  492. hotspots.risk_exposure
  493. :
  494. </span>
  495. <div
  496. className="hotspot-risk-badge spacer-left MEDIUM"
  497. >
  498. risk_exposure.MEDIUM
  499. </div>
  500. </div>
  501. <ul>
  502. <li
  503. className="spacer-bottom"
  504. key="cat1"
  505. >
  506. <HotspotCategory
  507. categoryKey="cat1"
  508. hotspots={
  509. Array [
  510. Object {
  511. "author": "Developer 1",
  512. "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
  513. "creationDate": "2013-05-13T17:55:39+0200",
  514. "key": "h3",
  515. "line": 81,
  516. "message": "'3' is a magic number.",
  517. "project": "com.github.kevinsawicki:http-request",
  518. "resolution": undefined,
  519. "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
  520. "securityCategory": "cat1",
  521. "status": "TO_REVIEW",
  522. "updateDate": "2013-05-13T17:55:39+0200",
  523. "vulnerabilityProbability": "MEDIUM",
  524. },
  525. Object {
  526. "author": "Developer 1",
  527. "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
  528. "creationDate": "2013-05-13T17:55:39+0200",
  529. "key": "h4",
  530. "line": 81,
  531. "message": "'3' is a magic number.",
  532. "project": "com.github.kevinsawicki:http-request",
  533. "resolution": undefined,
  534. "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
  535. "securityCategory": "cat1",
  536. "status": "TO_REVIEW",
  537. "updateDate": "2013-05-13T17:55:39+0200",
  538. "vulnerabilityProbability": "MEDIUM",
  539. },
  540. ]
  541. }
  542. isLastAndIncomplete={false}
  543. onHotspotClick={[MockFunction]}
  544. onLocationClick={[MockFunction]}
  545. onScroll={[MockFunction]}
  546. onToggleExpand={[Function]}
  547. selectedHotspot={
  548. Object {
  549. "author": "Developer 1",
  550. "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
  551. "creationDate": "2013-05-13T17:55:39+0200",
  552. "key": "h2",
  553. "line": 81,
  554. "message": "'3' is a magic number.",
  555. "project": "com.github.kevinsawicki:http-request",
  556. "resolution": undefined,
  557. "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
  558. "securityCategory": "command-injection",
  559. "status": "TO_REVIEW",
  560. "updateDate": "2013-05-13T17:55:39+0200",
  561. "vulnerabilityProbability": "HIGH",
  562. }
  563. }
  564. title="cat1"
  565. />
  566. </li>
  567. <li
  568. className="spacer-bottom"
  569. key="cat2"
  570. >
  571. <HotspotCategory
  572. categoryKey="cat2"
  573. hotspots={
  574. Array [
  575. Object {
  576. "author": "Developer 1",
  577. "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
  578. "creationDate": "2013-05-13T17:55:39+0200",
  579. "key": "h5",
  580. "line": 81,
  581. "message": "'3' is a magic number.",
  582. "project": "com.github.kevinsawicki:http-request",
  583. "resolution": undefined,
  584. "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
  585. "securityCategory": "cat2",
  586. "status": "TO_REVIEW",
  587. "updateDate": "2013-05-13T17:55:39+0200",
  588. "vulnerabilityProbability": "MEDIUM",
  589. },
  590. ]
  591. }
  592. isLastAndIncomplete={true}
  593. onHotspotClick={[MockFunction]}
  594. onLocationClick={[MockFunction]}
  595. onScroll={[MockFunction]}
  596. onToggleExpand={[Function]}
  597. selectedHotspot={
  598. Object {
  599. "author": "Developer 1",
  600. "component": "com.github.kevinsawicki:http-request:com.github.kevinsawicki.http.HttpRequest",
  601. "creationDate": "2013-05-13T17:55:39+0200",
  602. "key": "h2",
  603. "line": 81,
  604. "message": "'3' is a magic number.",
  605. "project": "com.github.kevinsawicki:http-request",
  606. "resolution": undefined,
  607. "rule": "checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck",
  608. "securityCategory": "command-injection",
  609. "status": "TO_REVIEW",
  610. "updateDate": "2013-05-13T17:55:39+0200",
  611. "vulnerabilityProbability": "HIGH",
  612. }
  613. }
  614. title="cat2"
  615. />
  616. </li>
  617. </ul>
  618. </li>
  619. </ul>
  620. <ListFooter
  621. count={5}
  622. loadMore={[MockFunction]}
  623. loading={false}
  624. total={7}
  625. />
  626. </div>
  627. `;