aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilippe Perrin <philippe.perrin@sonarsource.com>2021-02-24 18:37:27 +0100
committersonartech <sonartech@sonarsource.com>2021-02-25 20:07:33 +0000
commit26ca7559fab8b6a0379468a0a5b5f7d83c1baaa9 (patch)
treeda0249a75e1f1d08e6dbec84c5a0d318e99dda53
parentffaa8f3cd63239fc25c624955e8e0760dc53ce11 (diff)
downloadsonarqube-26ca7559fab8b6a0379468a0a5b5f7d83c1baaa9.tar.gz
sonarqube-26ca7559fab8b6a0379468a0a5b5f7d83c1baaa9.zip
SONAR-14513 Add e2e tests for security hotspots
-rw-r--r--server/sonar-web/src/main/js/apps/security-hotspots/components/FilterBar.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotReviewHistory.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotReviewHistoryAndComments.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotViewerRenderer.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/__snapshots__/FilterBar-test.tsx.snap8
-rw-r--r--server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/__snapshots__/HotspotReviewHistory-test.tsx.snap4
-rw-r--r--server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/__snapshots__/HotspotReviewHistoryAndComments-test.tsx.snap6
-rw-r--r--server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/__snapshots__/HotspotViewerRenderer-test.tsx.snap15
8 files changed, 26 insertions, 21 deletions
diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/FilterBar.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/FilterBar.tsx
index 921c07fb4b5..8cea9a03a74 100644
--- a/server/sonar-web/src/main/js/apps/security-hotspots/components/FilterBar.tsx
+++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/FilterBar.tsx
@@ -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'
diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotReviewHistory.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotReviewHistory.tsx
index edb85fa852e..a7765f34e6b 100644
--- a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotReviewHistory.tsx
+++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotReviewHistory.tsx
@@ -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>
)}
diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotReviewHistoryAndComments.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotReviewHistoryAndComments.tsx
index 9af216b9fe0..f959b0fa334 100644
--- a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotReviewHistoryAndComments.tsx
+++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotReviewHistoryAndComments.tsx
@@ -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')}
diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotViewerRenderer.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotViewerRenderer.tsx
index fec84299eb5..bf51befb62f 100644
--- a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotViewerRenderer.tsx
+++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotViewerRenderer.tsx
@@ -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} />
diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/__snapshots__/FilterBar-test.tsx.snap b/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/__snapshots__/FilterBar-test.tsx.snap
index 5363cfcb571..b45ba01e3c8 100644
--- a/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/__snapshots__/FilterBar-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/__snapshots__/FilterBar-test.tsx.snap
@@ -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"
diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/__snapshots__/HotspotReviewHistory-test.tsx.snap b/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/__snapshots__/HotspotReviewHistory-test.tsx.snap
index 193e141b151..c70652a47a0 100644
--- a/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/__snapshots__/HotspotReviewHistory-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/__snapshots__/HotspotReviewHistory-test.tsx.snap
@@ -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>
diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/__snapshots__/HotspotReviewHistoryAndComments-test.tsx.snap b/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/__snapshots__/HotspotReviewHistoryAndComments-test.tsx.snap
index 0ebc649edc0..8758b8bff1c 100644
--- a/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/__snapshots__/HotspotReviewHistoryAndComments-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/__snapshots__/HotspotReviewHistoryAndComments-test.tsx.snap
@@ -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={
diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/__snapshots__/HotspotViewerRenderer-test.tsx.snap b/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/__snapshots__/HotspotViewerRenderer-test.tsx.snap
index 957c63b84ac..29b5ea12a1f 100644
--- a/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/__snapshots__/HotspotViewerRenderer-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/__tests__/__snapshots__/HotspotViewerRenderer-test.tsx.snap
@@ -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"