aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web
diff options
context:
space:
mode:
authorJeremy Davis <jeremy.davis@sonarsource.com>2019-10-28 17:50:30 +0100
committersonartech <sonartech@sonarsource.com>2019-11-06 10:04:33 +0100
commit199b78fa48b55983bdd08e76446c7393bf9ea9f7 (patch)
treea8f11f0dc129c3d7c525dfa7821ed9f96b718c05 /server/sonar-web
parenta24a5da046e76d34acbac4721161db569b20751d (diff)
downloadsonarqube-199b78fa48b55983bdd08e76446c7393bf9ea9f7.tar.gz
sonarqube-199b78fa48b55983bdd08e76446c7393bf9ea9f7.zip
SONAR-12512 SONAR-12514 SONAR-12515 Add ITs
Diffstat (limited to 'server/sonar-web')
-rw-r--r--server/sonar-web/src/main/js/apps/settings/components/pullRequestDecoration/AlmPRDecorationTable.tsx8
-rw-r--r--server/sonar-web/src/main/js/apps/settings/components/pullRequestDecoration/TabHeader.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/settings/components/pullRequestDecoration/__tests__/__snapshots__/AlmPRDecorationTable-test.tsx.snap10
-rw-r--r--server/sonar-web/src/main/js/apps/settings/components/pullRequestDecoration/__tests__/__snapshots__/TabHeader-test.tsx.snap2
-rw-r--r--server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/PRDecorationBindingRenderer.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/__tests__/__snapshots__/PRDecorationBindingRenderer-test.tsx.snap6
6 files changed, 25 insertions, 9 deletions
diff --git a/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecoration/AlmPRDecorationTable.tsx b/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecoration/AlmPRDecorationTable.tsx
index 7aebe33e42e..251cf7b3e1a 100644
--- a/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecoration/AlmPRDecorationTable.tsx
+++ b/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecoration/AlmPRDecorationTable.tsx
@@ -55,14 +55,14 @@ export default function AlmPRDecorationTable(props: AlmPRDecorationTableProps) {
</thead>
<tbody>
{definitions.length === 0 ? (
- <tr>
+ <tr data-test="settings__alm-empty-table">
<td colSpan={3 + additionalColumnsHeaders.length}>
{translate('settings.pr_decoration.table.empty', alm)}
</td>
</tr>
) : (
definitions.map(({ key, additionalColumns }) => (
- <tr key={key}>
+ <tr data-test="settings__alm-table-row" key={key}>
<td className="nowrap hide-overflow" title={key}>
{key}
</td>
@@ -71,12 +71,12 @@ export default function AlmPRDecorationTable(props: AlmPRDecorationTableProps) {
{value}
</td>
))}
- <td className="text-center">
+ <td className="text-center" data-test="settings__alm-table-row-edit">
<ButtonIcon onClick={() => props.onEdit(key)}>
<EditIcon />
</ButtonIcon>
</td>
- <td className="text-center">
+ <td className="text-center" data-test="settings__alm-table-row-delete">
<DeleteButton onClick={() => props.onDelete(key)} />
</td>
</tr>
diff --git a/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecoration/TabHeader.tsx b/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecoration/TabHeader.tsx
index f6506c5126a..0ad31c0d701 100644
--- a/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecoration/TabHeader.tsx
+++ b/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecoration/TabHeader.tsx
@@ -50,7 +50,9 @@ export default function TabHeader(props: TabHeaderProps) {
<div className="big-spacer-bottom display-flex-space-between">
<h4 className="display-inline">{translate('settings.pr_decoration.table.title')}</h4>
- <Button onClick={props.onCreate}>{translate('settings.pr_decoration.table.create')}</Button>
+ <Button data-test="settings__alm-create" onClick={props.onCreate}>
+ {translate('settings.pr_decoration.table.create')}
+ </Button>
</div>
</>
);
diff --git a/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecoration/__tests__/__snapshots__/AlmPRDecorationTable-test.tsx.snap b/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecoration/__tests__/__snapshots__/AlmPRDecorationTable-test.tsx.snap
index 8e7fab9dfe0..1334b79e8bf 100644
--- a/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecoration/__tests__/__snapshots__/AlmPRDecorationTable-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecoration/__tests__/__snapshots__/AlmPRDecorationTable-test.tsx.snap
@@ -22,7 +22,9 @@ exports[`should render correctly 1`] = `
</tr>
</thead>
<tbody>
- <tr>
+ <tr
+ data-test="settings__alm-empty-table"
+ >
<td
colSpan={3}
>
@@ -66,6 +68,7 @@ exports[`should render correctly 2`] = `
</thead>
<tbody>
<tr
+ data-test="settings__alm-table-row"
key="definition1"
>
<td
@@ -90,6 +93,7 @@ exports[`should render correctly 2`] = `
</td>
<td
className="text-center"
+ data-test="settings__alm-table-row-edit"
>
<ButtonIcon
onClick={[Function]}
@@ -99,6 +103,7 @@ exports[`should render correctly 2`] = `
</td>
<td
className="text-center"
+ data-test="settings__alm-table-row-delete"
>
<DeleteButton
onClick={[Function]}
@@ -106,6 +111,7 @@ exports[`should render correctly 2`] = `
</td>
</tr>
<tr
+ data-test="settings__alm-table-row"
key="definition2"
>
<td
@@ -130,6 +136,7 @@ exports[`should render correctly 2`] = `
</td>
<td
className="text-center"
+ data-test="settings__alm-table-row-edit"
>
<ButtonIcon
onClick={[Function]}
@@ -139,6 +146,7 @@ exports[`should render correctly 2`] = `
</td>
<td
className="text-center"
+ data-test="settings__alm-table-row-delete"
>
<DeleteButton
onClick={[Function]}
diff --git a/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecoration/__tests__/__snapshots__/TabHeader-test.tsx.snap b/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecoration/__tests__/__snapshots__/TabHeader-test.tsx.snap
index 4b2607d1c8f..f2398aecdd7 100644
--- a/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecoration/__tests__/__snapshots__/TabHeader-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecoration/__tests__/__snapshots__/TabHeader-test.tsx.snap
@@ -32,6 +32,7 @@ exports[`should render correctly 1`] = `
settings.pr_decoration.table.title
</h4>
<Button
+ data-test="settings__alm-create"
onClick={[MockFunction]}
>
settings.pr_decoration.table.create
@@ -72,6 +73,7 @@ exports[`should render correctly 2`] = `
settings.pr_decoration.table.title
</h4>
<Button
+ data-test="settings__alm-create"
onClick={[MockFunction]}
>
settings.pr_decoration.table.create
diff --git a/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/PRDecorationBindingRenderer.tsx b/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/PRDecorationBindingRenderer.tsx
index 7a1eb479ada..7e3eab31522 100644
--- a/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/PRDecorationBindingRenderer.tsx
+++ b/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/PRDecorationBindingRenderer.tsx
@@ -230,12 +230,12 @@ export default function PRDecorationBindingRenderer(props: PRDecorationBindingRe
<DeferredSpinner className="spacer-right" loading={saving} />
{isChanged && (
<SubmitButton className="spacer-right button-success" disabled={saving || !isValid}>
- {translate('save')}
+ <span data-test="project-settings__alm-save">{translate('save')}</span>
</SubmitButton>
)}
{originalData && (
<Button className="spacer-right" onClick={props.onReset}>
- {translate('reset_verb')}
+ <span data-test="project-settings__alm-reset">{translate('reset_verb')}</span>
</Button>
)}
{!saving && success && (
diff --git a/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/__tests__/__snapshots__/PRDecorationBindingRenderer-test.tsx.snap b/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/__tests__/__snapshots__/PRDecorationBindingRenderer-test.tsx.snap
index 9d291a7610f..7cd05d1aa31 100644
--- a/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/__tests__/__snapshots__/PRDecorationBindingRenderer-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/__tests__/__snapshots__/PRDecorationBindingRenderer-test.tsx.snap
@@ -469,7 +469,11 @@ exports[`should render multiple instances correctly 2`] = `
className="spacer-right"
onClick={[MockFunction]}
>
- reset_verb
+ <span
+ data-test="project-settings__alm-reset"
+ >
+ reset_verb
+ </span>
</Button>
</div>
</form>