Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

CrossComponentSourceViewerWrapper-test.tsx.snap 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562
  1. // Jest Snapshot v1, https://goo.gl/fbAQLP
  2. exports[`Should handle no access rights 1`] = `
  3. <Alert
  4. className="spacer-top"
  5. variant="warning"
  6. >
  7. code_viewer.no_source_code_displayed_due_to_security
  8. </Alert>
  9. `;
  10. exports[`should handle duplication popup 1`] = `
  11. <Context.Consumer>
  12. [Function]
  13. </Context.Consumer>
  14. `;
  15. exports[`should render correctly 1`] = `
  16. <div>
  17. <DeferredSpinner />
  18. </div>
  19. `;
  20. exports[`should render correctly 2`] = `
  21. <div>
  22. <ContextProvider
  23. key="1-0-0"
  24. value={
  25. Object {
  26. "branchLike": undefined,
  27. "file": Object {
  28. "canMarkAsFavorite": true,
  29. "fav": false,
  30. "key": "project:main.js",
  31. "longName": "main.js",
  32. "measures": Object {
  33. "coverage": "85.2",
  34. "duplicationDensity": "1.0",
  35. "issues": "12",
  36. "lines": "56",
  37. },
  38. "name": "main.js",
  39. "path": "main.js",
  40. "project": "project",
  41. "projectName": "MyProject",
  42. "q": "FIL",
  43. "uuid": "foo-bar",
  44. },
  45. }
  46. }
  47. >
  48. <ComponentSourceSnippetGroupViewer
  49. duplicationsByLine={Object {}}
  50. isLastOccurenceOfPrimaryComponent={false}
  51. issue={
  52. Object {
  53. "actions": Array [],
  54. "component": "main.js",
  55. "componentLongName": "main.js",
  56. "componentQualifier": "FIL",
  57. "componentUuid": "foo1234",
  58. "creationDate": "2017-03-01T09:36:01+0100",
  59. "flows": Array [
  60. Array [
  61. Object {
  62. "component": "main.js",
  63. "textRange": Object {
  64. "endLine": 2,
  65. "endOffset": 2,
  66. "startLine": 1,
  67. "startOffset": 1,
  68. },
  69. },
  70. Object {
  71. "component": "main.js",
  72. "textRange": Object {
  73. "endLine": 2,
  74. "endOffset": 2,
  75. "startLine": 1,
  76. "startOffset": 1,
  77. },
  78. },
  79. Object {
  80. "component": "main.js",
  81. "textRange": Object {
  82. "endLine": 2,
  83. "endOffset": 2,
  84. "startLine": 1,
  85. "startOffset": 1,
  86. },
  87. },
  88. ],
  89. Array [
  90. Object {
  91. "component": "main.js",
  92. "textRange": Object {
  93. "endLine": 2,
  94. "endOffset": 2,
  95. "startLine": 1,
  96. "startOffset": 1,
  97. },
  98. },
  99. Object {
  100. "component": "main.js",
  101. "textRange": Object {
  102. "endLine": 2,
  103. "endOffset": 2,
  104. "startLine": 1,
  105. "startOffset": 1,
  106. },
  107. },
  108. ],
  109. ],
  110. "fromHotspot": false,
  111. "key": "1",
  112. "line": 25,
  113. "message": "Reduce the number of conditional operators (4) used in the expression",
  114. "project": "myproject",
  115. "projectKey": "foo",
  116. "projectName": "Foo",
  117. "rule": "javascript:S1067",
  118. "ruleName": "foo",
  119. "secondaryLocations": Array [
  120. Object {
  121. "component": "main.js",
  122. "textRange": Object {
  123. "endLine": 2,
  124. "endOffset": 2,
  125. "startLine": 1,
  126. "startOffset": 1,
  127. },
  128. },
  129. Object {
  130. "component": "main.js",
  131. "textRange": Object {
  132. "endLine": 2,
  133. "endOffset": 2,
  134. "startLine": 1,
  135. "startOffset": 1,
  136. },
  137. },
  138. ],
  139. "severity": "MAJOR",
  140. "status": "OPEN",
  141. "textRange": Object {
  142. "endLine": 26,
  143. "endOffset": 15,
  144. "startLine": 25,
  145. "startOffset": 0,
  146. },
  147. "transitions": Array [],
  148. "type": "BUG",
  149. }
  150. }
  151. issuesByLine={Object {}}
  152. lastSnippetGroup={true}
  153. loadDuplications={[Function]}
  154. locations={
  155. Array [
  156. Object {
  157. "component": "main.js",
  158. "index": 0,
  159. "textRange": Object {
  160. "endLine": 2,
  161. "endOffset": 2,
  162. "startLine": 1,
  163. "startOffset": 1,
  164. },
  165. },
  166. ]
  167. }
  168. onIssueChange={[MockFunction]}
  169. onIssuePopupToggle={[Function]}
  170. onLocationSelect={[MockFunction]}
  171. renderDuplicationPopup={[Function]}
  172. scroll={[MockFunction]}
  173. snippetGroup={
  174. Object {
  175. "component": Object {
  176. "canMarkAsFavorite": true,
  177. "fav": false,
  178. "key": "project:main.js",
  179. "longName": "main.js",
  180. "measures": Object {
  181. "coverage": "85.2",
  182. "duplicationDensity": "1.0",
  183. "issues": "12",
  184. "lines": "56",
  185. },
  186. "name": "main.js",
  187. "path": "main.js",
  188. "project": "project",
  189. "projectName": "MyProject",
  190. "q": "FIL",
  191. "uuid": "foo-bar",
  192. },
  193. "locations": Array [
  194. Object {
  195. "component": "main.js",
  196. "index": 0,
  197. "textRange": Object {
  198. "endLine": 2,
  199. "endOffset": 2,
  200. "startLine": 1,
  201. "startOffset": 1,
  202. },
  203. },
  204. ],
  205. "sources": Object {
  206. "16": Object {
  207. "code": "<span class=\\"k\\">import</span> java.util.<span class=\\"sym-9 sym\\">ArrayList</span>;",
  208. "coverageStatus": "covered",
  209. "coveredConditions": 2,
  210. "duplicated": false,
  211. "isNew": true,
  212. "line": 16,
  213. "scmAuthor": "simon.brandhof@sonarsource.com",
  214. "scmDate": "2018-12-11T10:48:39+0100",
  215. "scmRevision": "80f564becc0c0a1c9abaa006eca83a4fd278c3f0",
  216. },
  217. },
  218. }
  219. }
  220. />
  221. </ContextProvider>
  222. </div>
  223. `;
  224. exports[`should render correctly: no component found 1`] = `
  225. <div>
  226. <ContextProvider
  227. key="unknown-0-0"
  228. value={
  229. Object {
  230. "branchLike": undefined,
  231. "file": Object {},
  232. }
  233. }
  234. >
  235. <ComponentSourceSnippetGroupViewer
  236. duplicationsByLine={Object {}}
  237. isLastOccurenceOfPrimaryComponent={false}
  238. issue={
  239. Object {
  240. "actions": Array [],
  241. "component": "test.js",
  242. "componentLongName": "main.js",
  243. "componentQualifier": "FIL",
  244. "componentUuid": "foo1234",
  245. "creationDate": "2017-03-01T09:36:01+0100",
  246. "flows": Array [
  247. Array [
  248. Object {
  249. "component": "main.js",
  250. "textRange": Object {
  251. "endLine": 2,
  252. "endOffset": 2,
  253. "startLine": 1,
  254. "startOffset": 1,
  255. },
  256. },
  257. Object {
  258. "component": "main.js",
  259. "textRange": Object {
  260. "endLine": 2,
  261. "endOffset": 2,
  262. "startLine": 1,
  263. "startOffset": 1,
  264. },
  265. },
  266. Object {
  267. "component": "main.js",
  268. "textRange": Object {
  269. "endLine": 2,
  270. "endOffset": 2,
  271. "startLine": 1,
  272. "startOffset": 1,
  273. },
  274. },
  275. ],
  276. Array [
  277. Object {
  278. "component": "main.js",
  279. "textRange": Object {
  280. "endLine": 2,
  281. "endOffset": 2,
  282. "startLine": 1,
  283. "startOffset": 1,
  284. },
  285. },
  286. Object {
  287. "component": "main.js",
  288. "textRange": Object {
  289. "endLine": 2,
  290. "endOffset": 2,
  291. "startLine": 1,
  292. "startOffset": 1,
  293. },
  294. },
  295. ],
  296. ],
  297. "fromHotspot": false,
  298. "key": "unknown",
  299. "line": 25,
  300. "message": "Reduce the number of conditional operators (4) used in the expression",
  301. "project": "myproject",
  302. "projectKey": "foo",
  303. "projectName": "Foo",
  304. "rule": "javascript:S1067",
  305. "ruleName": "foo",
  306. "secondaryLocations": Array [
  307. Object {
  308. "component": "main.js",
  309. "textRange": Object {
  310. "endLine": 2,
  311. "endOffset": 2,
  312. "startLine": 1,
  313. "startOffset": 1,
  314. },
  315. },
  316. Object {
  317. "component": "main.js",
  318. "textRange": Object {
  319. "endLine": 2,
  320. "endOffset": 2,
  321. "startLine": 1,
  322. "startOffset": 1,
  323. },
  324. },
  325. ],
  326. "severity": "MAJOR",
  327. "status": "OPEN",
  328. "textRange": Object {
  329. "endLine": 26,
  330. "endOffset": 15,
  331. "startLine": 25,
  332. "startOffset": 0,
  333. },
  334. "transitions": Array [],
  335. "type": "BUG",
  336. }
  337. }
  338. issuesByLine={Object {}}
  339. lastSnippetGroup={false}
  340. loadDuplications={[Function]}
  341. locations={Array []}
  342. onIssueChange={[MockFunction]}
  343. onIssuePopupToggle={[Function]}
  344. onLocationSelect={[MockFunction]}
  345. renderDuplicationPopup={[Function]}
  346. scroll={[MockFunction]}
  347. snippetGroup={
  348. Object {
  349. "component": Object {},
  350. "locations": Array [],
  351. "sources": Array [],
  352. }
  353. }
  354. />
  355. </ContextProvider>
  356. <ContextProvider
  357. key="unknown-0-1"
  358. value={
  359. Object {
  360. "branchLike": undefined,
  361. "file": Object {
  362. "canMarkAsFavorite": true,
  363. "fav": false,
  364. "key": "project:main.js",
  365. "longName": "main.js",
  366. "measures": Object {
  367. "coverage": "85.2",
  368. "duplicationDensity": "1.0",
  369. "issues": "12",
  370. "lines": "56",
  371. },
  372. "name": "main.js",
  373. "path": "main.js",
  374. "project": "project",
  375. "projectName": "MyProject",
  376. "q": "FIL",
  377. "uuid": "foo-bar",
  378. },
  379. }
  380. }
  381. >
  382. <ComponentSourceSnippetGroupViewer
  383. duplicationsByLine={Object {}}
  384. isLastOccurenceOfPrimaryComponent={false}
  385. issue={
  386. Object {
  387. "actions": Array [],
  388. "component": "test.js",
  389. "componentLongName": "main.js",
  390. "componentQualifier": "FIL",
  391. "componentUuid": "foo1234",
  392. "creationDate": "2017-03-01T09:36:01+0100",
  393. "flows": Array [
  394. Array [
  395. Object {
  396. "component": "main.js",
  397. "textRange": Object {
  398. "endLine": 2,
  399. "endOffset": 2,
  400. "startLine": 1,
  401. "startOffset": 1,
  402. },
  403. },
  404. Object {
  405. "component": "main.js",
  406. "textRange": Object {
  407. "endLine": 2,
  408. "endOffset": 2,
  409. "startLine": 1,
  410. "startOffset": 1,
  411. },
  412. },
  413. Object {
  414. "component": "main.js",
  415. "textRange": Object {
  416. "endLine": 2,
  417. "endOffset": 2,
  418. "startLine": 1,
  419. "startOffset": 1,
  420. },
  421. },
  422. ],
  423. Array [
  424. Object {
  425. "component": "main.js",
  426. "textRange": Object {
  427. "endLine": 2,
  428. "endOffset": 2,
  429. "startLine": 1,
  430. "startOffset": 1,
  431. },
  432. },
  433. Object {
  434. "component": "main.js",
  435. "textRange": Object {
  436. "endLine": 2,
  437. "endOffset": 2,
  438. "startLine": 1,
  439. "startOffset": 1,
  440. },
  441. },
  442. ],
  443. ],
  444. "fromHotspot": false,
  445. "key": "unknown",
  446. "line": 25,
  447. "message": "Reduce the number of conditional operators (4) used in the expression",
  448. "project": "myproject",
  449. "projectKey": "foo",
  450. "projectName": "Foo",
  451. "rule": "javascript:S1067",
  452. "ruleName": "foo",
  453. "secondaryLocations": Array [
  454. Object {
  455. "component": "main.js",
  456. "textRange": Object {
  457. "endLine": 2,
  458. "endOffset": 2,
  459. "startLine": 1,
  460. "startOffset": 1,
  461. },
  462. },
  463. Object {
  464. "component": "main.js",
  465. "textRange": Object {
  466. "endLine": 2,
  467. "endOffset": 2,
  468. "startLine": 1,
  469. "startOffset": 1,
  470. },
  471. },
  472. ],
  473. "severity": "MAJOR",
  474. "status": "OPEN",
  475. "textRange": Object {
  476. "endLine": 26,
  477. "endOffset": 15,
  478. "startLine": 25,
  479. "startOffset": 0,
  480. },
  481. "transitions": Array [],
  482. "type": "BUG",
  483. }
  484. }
  485. issuesByLine={Object {}}
  486. lastSnippetGroup={true}
  487. loadDuplications={[Function]}
  488. locations={
  489. Array [
  490. Object {
  491. "component": "main.js",
  492. "index": 0,
  493. "textRange": Object {
  494. "endLine": 2,
  495. "endOffset": 2,
  496. "startLine": 1,
  497. "startOffset": 1,
  498. },
  499. },
  500. ]
  501. }
  502. onIssueChange={[MockFunction]}
  503. onIssuePopupToggle={[Function]}
  504. onLocationSelect={[MockFunction]}
  505. renderDuplicationPopup={[Function]}
  506. scroll={[MockFunction]}
  507. snippetGroup={
  508. Object {
  509. "component": Object {
  510. "canMarkAsFavorite": true,
  511. "fav": false,
  512. "key": "project:main.js",
  513. "longName": "main.js",
  514. "measures": Object {
  515. "coverage": "85.2",
  516. "duplicationDensity": "1.0",
  517. "issues": "12",
  518. "lines": "56",
  519. },
  520. "name": "main.js",
  521. "path": "main.js",
  522. "project": "project",
  523. "projectName": "MyProject",
  524. "q": "FIL",
  525. "uuid": "foo-bar",
  526. },
  527. "locations": Array [
  528. Object {
  529. "component": "main.js",
  530. "index": 0,
  531. "textRange": Object {
  532. "endLine": 2,
  533. "endOffset": 2,
  534. "startLine": 1,
  535. "startOffset": 1,
  536. },
  537. },
  538. ],
  539. "sources": Object {
  540. "16": Object {
  541. "code": "<span class=\\"k\\">import</span> java.util.<span class=\\"sym-9 sym\\">ArrayList</span>;",
  542. "coverageStatus": "covered",
  543. "coveredConditions": 2,
  544. "duplicated": false,
  545. "isNew": true,
  546. "line": 16,
  547. "scmAuthor": "simon.brandhof@sonarsource.com",
  548. "scmDate": "2018-12-11T10:48:39+0100",
  549. "scmRevision": "80f564becc0c0a1c9abaa006eca83a4fd278c3f0",
  550. },
  551. },
  552. }
  553. }
  554. />
  555. </ContextProvider>
  556. </div>
  557. `;