]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-14513 Add e2e tests for security hotspots
authorPhilippe Perrin <philippe.perrin@sonarsource.com>
Wed, 24 Feb 2021 17:37:27 +0000 (18:37 +0100)
committersonartech <sonartech@sonarsource.com>
Thu, 25 Feb 2021 20:07:33 +0000 (20:07 +0000)
server/sonar-web/src/main/js/apps/security-hotspots/components/FilterBar.tsx
server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotReviewHistory.tsx
server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotReviewHistoryAndComments.tsx
server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotViewerRenderer.tsx
server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/__snapshots__/FilterBar-test.tsx.snap
server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/__snapshots__/HotspotReviewHistory-test.tsx.snap
server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/__snapshots__/HotspotReviewHistoryAndComments-test.tsx.snap
server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/__snapshots__/HotspotViewerRenderer-test.tsx.snap

index 921c07fb4b5068a52c803f88c798c5a76f1ece4d..8cea9a03a7498190a1974ca88556cf8c7b232e30 100644 (file)
@@ -144,7 +144,7 @@ export function FilterBar(props: FilterBarProps) {
                   <DeferredSpinner loading={loadingMeasure}>
                     {hotspotsReviewedMeasure && <CoverageRating value={hotspotsReviewedMeasure} />}
                     <Measure
-                      className="spacer-left huge"
+                      className="spacer-left huge it__hs-review-percentage"
                       metricKey={
                         onBranch && !filters.sinceLeakPeriod
                           ? 'security_hotspots_reviewed'
index edb85fa852e7d4c3c8ff5fb1961ae6d7f5a51000..a7765f34e6b863c9bc34220adffb6fdc0f49fc5d 100644 (file)
@@ -111,7 +111,7 @@ export default function HotspotReviewHistory(props: HotspotReviewHistoryProps) {
                           </DropdownOverlay>
                         }>
                         <EditButton
-                          className="it__hotspots-comment-edit button-small"
+                          className="button-small"
                           onClick={() => setEditedCommentKey(key)}
                         />
                       </Toggler>
@@ -129,7 +129,7 @@ export default function HotspotReviewHistory(props: HotspotReviewHistoryProps) {
                         </div>
                       }
                       overlayPlacement={PopupPlacement.BottomRight}>
-                      <DeleteButton className="it__hotspots-comment-delete button-small" />
+                      <DeleteButton className="button-small" />
                     </Dropdown>
                   </div>
                 )}
index 9af216b9fe05823add55e6262bcf588bd8a25ba3..f959b0fa334c15de82ff37ba70791d92624fe469 100644 (file)
@@ -96,7 +96,7 @@ export default class HotspotReviewHistoryAndComments extends React.PureComponent
     return (
       <>
         <h1>{translate('hotspot.section.activity')}</h1>
-        <div className="padded">
+        <div className="padded it__hs-review-history">
           <HotspotReviewHistory
             hotspot={hotspot}
             onDeleteComment={this.handleDeleteComment}
@@ -108,7 +108,7 @@ export default class HotspotReviewHistoryAndComments extends React.PureComponent
               <hr />
               <div className="big-spacer-top">
                 <Button
-                  className={classNames({ invisible: commentVisible })}
+                  className={classNames('it__hs-add-comment', { invisible: commentVisible })}
                   id="hotspot-comment-box-display"
                   onClick={this.props.onOpenComment}>
                   {translate('hotspots.comment.open')}
index fec84299eb57734988c730e1e4a4600b61eaf373..bf51befb62f9e9bce40c2cf987372338b5e0d9ef 100644 (file)
@@ -83,7 +83,7 @@ export function HotspotViewerRenderer(props: HotspotViewerRendererProps) {
               {isLoggedIn(currentUser) && (
                 <>
                   <div className="dropdown spacer-right flex-1-0-auto">
-                    <Button onClick={props.onOpenComment}>
+                    <Button className="it__hs-add-comment" onClick={props.onOpenComment}>
                       {translate('hotspots.comment.open')}
                     </Button>
                   </div>
@@ -120,7 +120,7 @@ export function HotspotViewerRenderer(props: HotspotViewerRendererProps) {
                   {translate('risk_exposure', hotspot.rule.vulnerabilityProbability)}
                 </div>
               </div>
-              <div className="display-flex-center">
+              <div className="display-flex-center it__hs-assignee">
                 <span className="big-spacer-right">{translate('assignee')}</span>
                 <div>
                   <Assignee hotspot={hotspot} onAssigneeChange={props.onUpdateHotspot} />
index 5363cfcb57118286622025e9028646ecef1a3017..b45ba01e3c864fe3fbd75cc66910b33f3d87a1d8 100644 (file)
@@ -108,7 +108,7 @@ exports[`should render correctly: anonymous 1`] = `
             loading={false}
           >
             <Measure
-              className="spacer-left huge"
+              className="spacer-left huge it__hs-review-percentage"
               metricKey="security_hotspots_reviewed"
               metricType="PERCENT"
             />
@@ -224,7 +224,7 @@ exports[`should render correctly: logged-in 1`] = `
             loading={false}
           >
             <Measure
-              className="spacer-left huge"
+              className="spacer-left huge it__hs-review-percentage"
               metricKey="security_hotspots_reviewed"
               metricType="PERCENT"
             />
@@ -396,7 +396,7 @@ exports[`should render correctly: on Pull request 1`] = `
             loading={false}
           >
             <Measure
-              className="spacer-left huge"
+              className="spacer-left huge it__hs-review-percentage"
               metricKey="new_security_hotspots_reviewed"
               metricType="PERCENT"
             />
@@ -496,7 +496,7 @@ exports[`should render correctly: with hotspots reviewed measure 1`] = `
               value="23.30"
             />
             <Measure
-              className="spacer-left huge"
+              className="spacer-left huge it__hs-review-percentage"
               metricKey="security_hotspots_reviewed"
               metricType="PERCENT"
               value="23.30"
index 193e141b151e42258d48630d133ec8573ea32f36..c70652a47a0229443cfb87d836cf8d4e79fc69be 100644 (file)
@@ -92,7 +92,7 @@ exports[`should render correctly 1`] = `
             }
           >
             <EditButton
-              className="it__hotspots-comment-edit button-small"
+              className="button-small"
               onClick={[Function]}
             />
           </Toggler>
@@ -117,7 +117,7 @@ exports[`should render correctly 1`] = `
           overlayPlacement="bottom-right"
         >
           <DeleteButton
-            className="it__hotspots-comment-delete button-small"
+            className="button-small"
           />
         </Dropdown>
       </div>
index 0ebc649edc038c8ed1c44f0a39219bb82fb04961..8758b8bff1c0caea7f4faf86fdbc085dd9f1ed53 100644 (file)
@@ -6,7 +6,7 @@ exports[`should render correctly 1`] = `
     hotspot.section.activity
   </h1>
   <div
-    className="padded"
+    className="padded it__hs-review-history"
   >
     <HotspotReviewHistory
       hotspot={
@@ -114,7 +114,7 @@ exports[`should render correctly 1`] = `
       className="big-spacer-top"
     >
       <Button
-        className=""
+        className="it__hs-add-comment"
         id="hotspot-comment-box-display"
         onClick={[MockFunction]}
       >
@@ -169,7 +169,7 @@ exports[`should render correctly without user 1`] = `
     hotspot.section.activity
   </h1>
   <div
-    className="padded"
+    className="padded it__hs-review-history"
   >
     <HotspotReviewHistory
       hotspot={
index 957c63b84ace5eb5301a2af44a8749a925dbbd1e..29b5ea12a1f0f678d29d63d954b8b06f12d5c073 100644 (file)
@@ -23,6 +23,7 @@ exports[`should render correctly 1`] = `
           className="dropdown spacer-right flex-1-0-auto"
         >
           <Button
+            className="it__hs-add-comment"
             onClick={[MockFunction]}
           >
             hotspots.comment.open
@@ -84,7 +85,7 @@ exports[`should render correctly 1`] = `
           </div>
         </div>
         <div
-          className="display-flex-center"
+          className="display-flex-center it__hs-assignee"
         >
           <span
             className="big-spacer-right"
@@ -668,6 +669,7 @@ exports[`should render correctly: anonymous user 1`] = `
           className="dropdown spacer-right flex-1-0-auto"
         >
           <Button
+            className="it__hs-add-comment"
             onClick={[MockFunction]}
           >
             hotspots.comment.open
@@ -729,7 +731,7 @@ exports[`should render correctly: anonymous user 1`] = `
           </div>
         </div>
         <div
-          className="display-flex-center"
+          className="display-flex-center it__hs-assignee"
         >
           <span
             className="big-spacer-right"
@@ -1313,6 +1315,7 @@ exports[`should render correctly: assignee without name 1`] = `
           className="dropdown spacer-right flex-1-0-auto"
         >
           <Button
+            className="it__hs-add-comment"
             onClick={[MockFunction]}
           >
             hotspots.comment.open
@@ -1374,7 +1377,7 @@ exports[`should render correctly: assignee without name 1`] = `
           </div>
         </div>
         <div
-          className="display-flex-center"
+          className="display-flex-center it__hs-assignee"
         >
           <span
             className="big-spacer-right"
@@ -1958,6 +1961,7 @@ exports[`should render correctly: deleted assignee 1`] = `
           className="dropdown spacer-right flex-1-0-auto"
         >
           <Button
+            className="it__hs-add-comment"
             onClick={[MockFunction]}
           >
             hotspots.comment.open
@@ -2019,7 +2023,7 @@ exports[`should render correctly: deleted assignee 1`] = `
           </div>
         </div>
         <div
-          className="display-flex-center"
+          className="display-flex-center it__hs-assignee"
         >
           <span
             className="big-spacer-right"
@@ -2610,6 +2614,7 @@ exports[`should render correctly: unassigned 1`] = `
           className="dropdown spacer-right flex-1-0-auto"
         >
           <Button
+            className="it__hs-add-comment"
             onClick={[MockFunction]}
           >
             hotspots.comment.open
@@ -2671,7 +2676,7 @@ exports[`should render correctly: unassigned 1`] = `
           </div>
         </div>
         <div
-          className="display-flex-center"
+          className="display-flex-center it__hs-assignee"
         >
           <span
             className="big-spacer-right"