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.

QualityGatePanel-test.tsx.snap 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770
  1. // Jest Snapshot v1, https://goo.gl/fbAQLP
  2. exports[`should render correctly for applications 1`] = `
  3. <div
  4. className="overview-panel"
  5. data-test="overview__quality-gate-panel"
  6. >
  7. <div
  8. className="display-flex-center spacer-bottom"
  9. >
  10. <h2
  11. className="overview-panel-title null-spacer-bottom"
  12. >
  13. overview.quality_gate
  14. </h2>
  15. <HelpTooltip
  16. className="little-spacer-left"
  17. overlay={
  18. <div
  19. className="big-padded-top big-padded-bottom"
  20. >
  21. overview.quality_gate.help
  22. </div>
  23. }
  24. />
  25. </div>
  26. <div>
  27. <div
  28. className="overview-quality-gate-badge-large failed"
  29. >
  30. <h3
  31. className="big-spacer-bottom huge"
  32. >
  33. metric.level.ERROR
  34. </h3>
  35. <span
  36. className="small"
  37. >
  38. overview.X_conditions_failed.3
  39. </span>
  40. </div>
  41. <div
  42. data-test="overview__quality-gate-conditions"
  43. >
  44. <Memo(QualityGatePanelSection)
  45. component={
  46. {
  47. "breadcrumbs": [],
  48. "key": "my-project",
  49. "name": "MyProject",
  50. "qualifier": "APP",
  51. "qualityGate": {
  52. "isDefault": true,
  53. "key": "30",
  54. "name": "Sonar way",
  55. },
  56. "qualityProfiles": [
  57. {
  58. "deleted": false,
  59. "key": "my-qp",
  60. "language": "ts",
  61. "name": "Sonar way",
  62. },
  63. ],
  64. "tags": [],
  65. }
  66. }
  67. key="foo"
  68. qgStatus={
  69. {
  70. "caycStatus": "compliant",
  71. "failedConditions": [
  72. {
  73. "actual": "10",
  74. "error": "0",
  75. "level": "ERROR",
  76. "measure": {
  77. "bestValue": true,
  78. "leak": "1",
  79. "metric": {
  80. "id": "coverage",
  81. "key": "coverage",
  82. "name": "coverage",
  83. "type": "PERCENT",
  84. },
  85. "period": {
  86. "bestValue": true,
  87. "index": 1,
  88. "value": "1.0",
  89. },
  90. "value": "1.0",
  91. },
  92. "metric": "foo",
  93. "op": "GT",
  94. },
  95. ],
  96. "ignoredConditions": false,
  97. "key": "foo",
  98. "name": "Foo",
  99. "status": "ERROR",
  100. }
  101. }
  102. />
  103. <Memo(QualityGatePanelSection)
  104. component={
  105. {
  106. "breadcrumbs": [],
  107. "key": "my-project",
  108. "name": "MyProject",
  109. "qualifier": "APP",
  110. "qualityGate": {
  111. "isDefault": true,
  112. "key": "30",
  113. "name": "Sonar way",
  114. },
  115. "qualityProfiles": [
  116. {
  117. "deleted": false,
  118. "key": "my-qp",
  119. "language": "ts",
  120. "name": "Sonar way",
  121. },
  122. ],
  123. "tags": [],
  124. }
  125. }
  126. key="foo"
  127. qgStatus={
  128. {
  129. "caycStatus": "compliant",
  130. "failedConditions": [
  131. {
  132. "actual": "10",
  133. "error": "0",
  134. "level": "ERROR",
  135. "measure": {
  136. "bestValue": true,
  137. "leak": "1",
  138. "metric": {
  139. "id": "coverage",
  140. "key": "coverage",
  141. "name": "coverage",
  142. "type": "PERCENT",
  143. },
  144. "period": {
  145. "bestValue": true,
  146. "index": 1,
  147. "value": "1.0",
  148. },
  149. "value": "1.0",
  150. },
  151. "metric": "foo",
  152. "op": "GT",
  153. },
  154. {
  155. "actual": "10",
  156. "error": "0",
  157. "level": "ERROR",
  158. "measure": {
  159. "bestValue": true,
  160. "leak": "1",
  161. "metric": {
  162. "id": "new_code_smells",
  163. "key": "new_code_smells",
  164. "name": "new_code_smells",
  165. "type": "PERCENT",
  166. },
  167. "period": {
  168. "bestValue": true,
  169. "index": 1,
  170. "value": "1.0",
  171. },
  172. "value": "1.0",
  173. },
  174. "metric": "new_code_smells",
  175. "op": "GT",
  176. },
  177. ],
  178. "ignoredConditions": false,
  179. "key": "foo",
  180. "name": "Foo",
  181. "status": "ERROR",
  182. }
  183. }
  184. />
  185. </div>
  186. </div>
  187. <withCurrentUserContext(SonarLintPromotion)
  188. qgConditions={
  189. [
  190. {
  191. "actual": "10",
  192. "error": "0",
  193. "level": "ERROR",
  194. "measure": {
  195. "bestValue": true,
  196. "leak": "1",
  197. "metric": {
  198. "id": "coverage",
  199. "key": "coverage",
  200. "name": "coverage",
  201. "type": "PERCENT",
  202. },
  203. "period": {
  204. "bestValue": true,
  205. "index": 1,
  206. "value": "1.0",
  207. },
  208. "value": "1.0",
  209. },
  210. "metric": "foo",
  211. "op": "GT",
  212. },
  213. {
  214. "actual": "10",
  215. "error": "0",
  216. "level": "ERROR",
  217. "measure": {
  218. "bestValue": true,
  219. "leak": "1",
  220. "metric": {
  221. "id": "coverage",
  222. "key": "coverage",
  223. "name": "coverage",
  224. "type": "PERCENT",
  225. },
  226. "period": {
  227. "bestValue": true,
  228. "index": 1,
  229. "value": "1.0",
  230. },
  231. "value": "1.0",
  232. },
  233. "metric": "foo",
  234. "op": "GT",
  235. },
  236. {
  237. "actual": "10",
  238. "error": "0",
  239. "level": "ERROR",
  240. "measure": {
  241. "bestValue": true,
  242. "leak": "1",
  243. "metric": {
  244. "id": "new_code_smells",
  245. "key": "new_code_smells",
  246. "name": "new_code_smells",
  247. "type": "PERCENT",
  248. },
  249. "period": {
  250. "bestValue": true,
  251. "index": 1,
  252. "value": "1.0",
  253. },
  254. "value": "1.0",
  255. },
  256. "metric": "new_code_smells",
  257. "op": "GT",
  258. },
  259. ]
  260. }
  261. />
  262. </div>
  263. `;
  264. exports[`should render correctly for applications 2`] = `
  265. <div
  266. className="overview-panel"
  267. data-test="overview__quality-gate-panel"
  268. >
  269. <div
  270. className="display-flex-center spacer-bottom"
  271. >
  272. <h2
  273. className="overview-panel-title null-spacer-bottom"
  274. >
  275. overview.quality_gate
  276. </h2>
  277. <HelpTooltip
  278. className="little-spacer-left"
  279. overlay={
  280. <div
  281. className="big-padded-top big-padded-bottom"
  282. >
  283. overview.quality_gate.help
  284. </div>
  285. }
  286. />
  287. </div>
  288. <div>
  289. <div
  290. className="overview-quality-gate-badge-large failed"
  291. >
  292. <h3
  293. className="big-spacer-bottom huge"
  294. >
  295. metric.level.ERROR
  296. </h3>
  297. <span
  298. className="small"
  299. >
  300. overview.X_conditions_failed.1
  301. </span>
  302. </div>
  303. <div
  304. data-test="overview__quality-gate-conditions"
  305. >
  306. <Memo(QualityGatePanelSection)
  307. component={
  308. {
  309. "breadcrumbs": [],
  310. "key": "my-project",
  311. "name": "MyProject",
  312. "qualifier": "APP",
  313. "qualityGate": {
  314. "isDefault": true,
  315. "key": "30",
  316. "name": "Sonar way",
  317. },
  318. "qualityProfiles": [
  319. {
  320. "deleted": false,
  321. "key": "my-qp",
  322. "language": "ts",
  323. "name": "Sonar way",
  324. },
  325. ],
  326. "tags": [],
  327. }
  328. }
  329. key="foo"
  330. qgStatus={
  331. {
  332. "caycStatus": "compliant",
  333. "failedConditions": [
  334. {
  335. "actual": "10",
  336. "error": "0",
  337. "level": "ERROR",
  338. "measure": {
  339. "bestValue": true,
  340. "leak": "1",
  341. "metric": {
  342. "id": "coverage",
  343. "key": "coverage",
  344. "name": "coverage",
  345. "type": "PERCENT",
  346. },
  347. "period": {
  348. "bestValue": true,
  349. "index": 1,
  350. "value": "1.0",
  351. },
  352. "value": "1.0",
  353. },
  354. "metric": "foo",
  355. "op": "GT",
  356. },
  357. ],
  358. "ignoredConditions": false,
  359. "key": "foo",
  360. "name": "Foo",
  361. "status": "ERROR",
  362. }
  363. }
  364. />
  365. <Memo(QualityGatePanelSection)
  366. component={
  367. {
  368. "breadcrumbs": [],
  369. "key": "my-project",
  370. "name": "MyProject",
  371. "qualifier": "APP",
  372. "qualityGate": {
  373. "isDefault": true,
  374. "key": "30",
  375. "name": "Sonar way",
  376. },
  377. "qualityProfiles": [
  378. {
  379. "deleted": false,
  380. "key": "my-qp",
  381. "language": "ts",
  382. "name": "Sonar way",
  383. },
  384. ],
  385. "tags": [],
  386. }
  387. }
  388. key="foo"
  389. qgStatus={
  390. {
  391. "caycStatus": "compliant",
  392. "failedConditions": [],
  393. "ignoredConditions": false,
  394. "key": "foo",
  395. "name": "Foo",
  396. "status": "OK",
  397. }
  398. }
  399. />
  400. </div>
  401. </div>
  402. <withCurrentUserContext(SonarLintPromotion)
  403. qgConditions={
  404. [
  405. {
  406. "actual": "10",
  407. "error": "0",
  408. "level": "ERROR",
  409. "measure": {
  410. "bestValue": true,
  411. "leak": "1",
  412. "metric": {
  413. "id": "coverage",
  414. "key": "coverage",
  415. "name": "coverage",
  416. "type": "PERCENT",
  417. },
  418. "period": {
  419. "bestValue": true,
  420. "index": 1,
  421. "value": "1.0",
  422. },
  423. "value": "1.0",
  424. },
  425. "metric": "foo",
  426. "op": "GT",
  427. },
  428. ]
  429. }
  430. />
  431. </div>
  432. `;
  433. exports[`should render correctly for projects 1`] = `
  434. <div
  435. className="overview-panel"
  436. data-test="overview__quality-gate-panel"
  437. >
  438. <div
  439. className="display-flex-center spacer-bottom"
  440. >
  441. <h2
  442. className="overview-panel-title null-spacer-bottom"
  443. >
  444. overview.quality_gate
  445. </h2>
  446. <HelpTooltip
  447. className="little-spacer-left"
  448. overlay={
  449. <div
  450. className="big-padded-top big-padded-bottom"
  451. >
  452. overview.quality_gate.help
  453. </div>
  454. }
  455. />
  456. </div>
  457. <div>
  458. <div
  459. className="overview-quality-gate-badge-large failed"
  460. >
  461. <h3
  462. className="big-spacer-bottom huge"
  463. >
  464. metric.level.ERROR
  465. </h3>
  466. <span
  467. className="small"
  468. >
  469. overview.X_conditions_failed.1
  470. </span>
  471. </div>
  472. <div
  473. data-test="overview__quality-gate-conditions"
  474. >
  475. <Memo(QualityGatePanelSection)
  476. component={
  477. {
  478. "breadcrumbs": [],
  479. "key": "my-project",
  480. "name": "MyProject",
  481. "qualifier": "TRK",
  482. "qualityGate": {
  483. "isDefault": true,
  484. "key": "30",
  485. "name": "Sonar way",
  486. },
  487. "qualityProfiles": [
  488. {
  489. "deleted": false,
  490. "key": "my-qp",
  491. "language": "ts",
  492. "name": "Sonar way",
  493. },
  494. ],
  495. "tags": [],
  496. }
  497. }
  498. key="foo"
  499. qgStatus={
  500. {
  501. "caycStatus": "compliant",
  502. "failedConditions": [
  503. {
  504. "actual": "10",
  505. "error": "0",
  506. "level": "ERROR",
  507. "measure": {
  508. "bestValue": true,
  509. "leak": "1",
  510. "metric": {
  511. "id": "coverage",
  512. "key": "coverage",
  513. "name": "coverage",
  514. "type": "PERCENT",
  515. },
  516. "period": {
  517. "bestValue": true,
  518. "index": 1,
  519. "value": "1.0",
  520. },
  521. "value": "1.0",
  522. },
  523. "metric": "foo",
  524. "op": "GT",
  525. },
  526. ],
  527. "ignoredConditions": false,
  528. "key": "foo",
  529. "name": "Foo",
  530. "status": "ERROR",
  531. }
  532. }
  533. />
  534. </div>
  535. </div>
  536. <withCurrentUserContext(SonarLintPromotion)
  537. qgConditions={
  538. [
  539. {
  540. "actual": "10",
  541. "error": "0",
  542. "level": "ERROR",
  543. "measure": {
  544. "bestValue": true,
  545. "leak": "1",
  546. "metric": {
  547. "id": "coverage",
  548. "key": "coverage",
  549. "name": "coverage",
  550. "type": "PERCENT",
  551. },
  552. "period": {
  553. "bestValue": true,
  554. "index": 1,
  555. "value": "1.0",
  556. },
  557. "value": "1.0",
  558. },
  559. "metric": "foo",
  560. "op": "GT",
  561. },
  562. ]
  563. }
  564. />
  565. </div>
  566. `;
  567. exports[`should render correctly for projects 2`] = `
  568. <div
  569. className="overview-panel"
  570. data-test="overview__quality-gate-panel"
  571. >
  572. <div
  573. className="display-flex-center spacer-bottom"
  574. >
  575. <h2
  576. className="overview-panel-title null-spacer-bottom"
  577. >
  578. overview.quality_gate
  579. </h2>
  580. <HelpTooltip
  581. className="little-spacer-left"
  582. overlay={
  583. <div
  584. className="big-padded-top big-padded-bottom"
  585. >
  586. overview.quality_gate.help
  587. </div>
  588. }
  589. />
  590. </div>
  591. <div>
  592. <div
  593. className="overview-quality-gate-badge-large success"
  594. >
  595. <h3
  596. className="big-spacer-bottom huge"
  597. >
  598. metric.level.OK
  599. </h3>
  600. <span
  601. className="small"
  602. >
  603. overview.quality_gate_all_conditions_passed
  604. </span>
  605. </div>
  606. </div>
  607. <withCurrentUserContext(SonarLintPromotion)
  608. qgConditions={[]}
  609. />
  610. </div>
  611. `;
  612. exports[`should render correctly for projects 3`] = `
  613. <div
  614. className="overview-panel"
  615. data-test="overview__quality-gate-panel"
  616. >
  617. <div
  618. className="display-flex-center spacer-bottom"
  619. >
  620. <h2
  621. className="overview-panel-title null-spacer-bottom"
  622. >
  623. overview.quality_gate
  624. </h2>
  625. <HelpTooltip
  626. className="little-spacer-left"
  627. overlay={
  628. <div
  629. className="big-padded-top big-padded-bottom"
  630. >
  631. overview.quality_gate.help
  632. </div>
  633. }
  634. />
  635. </div>
  636. <Alert
  637. className="big-spacer-bottom"
  638. display="inline"
  639. variant="info"
  640. >
  641. <span
  642. className="text-middle"
  643. >
  644. overview.quality_gate.ignored_conditions
  645. </span>
  646. <HelpTooltip
  647. className="spacer-left"
  648. overlay="overview.quality_gate.ignored_conditions.tooltip"
  649. />
  650. </Alert>
  651. <div>
  652. <div
  653. className="overview-quality-gate-badge-large failed"
  654. >
  655. <h3
  656. className="big-spacer-bottom huge"
  657. >
  658. metric.level.ERROR
  659. </h3>
  660. <span
  661. className="small"
  662. >
  663. overview.X_conditions_failed.1
  664. </span>
  665. </div>
  666. <div
  667. data-test="overview__quality-gate-conditions"
  668. >
  669. <Memo(QualityGatePanelSection)
  670. component={
  671. {
  672. "breadcrumbs": [],
  673. "key": "my-project",
  674. "name": "MyProject",
  675. "qualifier": "TRK",
  676. "qualityGate": {
  677. "isDefault": true,
  678. "key": "30",
  679. "name": "Sonar way",
  680. },
  681. "qualityProfiles": [
  682. {
  683. "deleted": false,
  684. "key": "my-qp",
  685. "language": "ts",
  686. "name": "Sonar way",
  687. },
  688. ],
  689. "tags": [],
  690. }
  691. }
  692. key="foo"
  693. qgStatus={
  694. {
  695. "caycStatus": "compliant",
  696. "failedConditions": [
  697. {
  698. "actual": "10",
  699. "error": "0",
  700. "level": "ERROR",
  701. "measure": {
  702. "bestValue": true,
  703. "leak": "1",
  704. "metric": {
  705. "id": "coverage",
  706. "key": "coverage",
  707. "name": "coverage",
  708. "type": "PERCENT",
  709. },
  710. "period": {
  711. "bestValue": true,
  712. "index": 1,
  713. "value": "1.0",
  714. },
  715. "value": "1.0",
  716. },
  717. "metric": "foo",
  718. "op": "GT",
  719. },
  720. ],
  721. "ignoredConditions": true,
  722. "key": "foo",
  723. "name": "Foo",
  724. "status": "ERROR",
  725. }
  726. }
  727. />
  728. </div>
  729. </div>
  730. <withCurrentUserContext(SonarLintPromotion)
  731. qgConditions={
  732. [
  733. {
  734. "actual": "10",
  735. "error": "0",
  736. "level": "ERROR",
  737. "measure": {
  738. "bestValue": true,
  739. "leak": "1",
  740. "metric": {
  741. "id": "coverage",
  742. "key": "coverage",
  743. "name": "coverage",
  744. "type": "PERCENT",
  745. },
  746. "period": {
  747. "bestValue": true,
  748. "index": 1,
  749. "value": "1.0",
  750. },
  751. "value": "1.0",
  752. },
  753. "metric": "foo",
  754. "op": "GT",
  755. },
  756. ]
  757. }
  758. />
  759. </div>
  760. `;