Skip to content

Commit bd5f550

Browse files
committed
Address additional review comments
Signed-off-by: Nandini Chandra <[email protected]>
1 parent bc10596 commit bd5f550

File tree

2 files changed

+34
-22
lines changed

2 files changed

+34
-22
lines changed

cypress/e2e/models/administration/source-platform/source-platform.ts

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -108,34 +108,40 @@ export class SourcePlatform {
108108
}
109109

110110
edit(
111-
updatedValues: {
112-
name?: string;
113-
url?: string;
114-
credentials?: string;
115-
},
111+
updatedValues: Partial<{
112+
name: string;
113+
url: string;
114+
credentials: string;
115+
}>,
116116
cancel = false
117117
): void {
118118
SourcePlatform.open();
119119
performRowActionByIcon(this.name, commonView.pencilAction);
120120

121121
if (cancel) {
122122
cancelForm();
123-
} else {
124-
if (updatedValues.name && updatedValues.name !== this.name) {
125-
this.fillName(updatedValues.name);
126-
this.name = updatedValues.name;
127-
}
128-
if (updatedValues.url && updatedValues.url !== this.url) {
129-
this.fillUrl(updatedValues.url);
130-
this.url = updatedValues.url;
131-
}
132-
if (updatedValues.credentials && updatedValues.credentials !== this.credentials) {
133-
this.selectCredentials(updatedValues.credentials);
134-
this.credentials = updatedValues.credentials;
135-
}
136-
if (updatedValues) {
137-
submitForm();
138-
}
123+
return;
124+
}
125+
126+
const { name, url, credentials } = updatedValues;
127+
128+
if (name && name !== this.name) {
129+
this.fillName(name);
130+
this.name = name;
131+
}
132+
133+
if (url && url !== this.url) {
134+
this.fillUrl(url);
135+
this.url = url;
136+
}
137+
138+
if (credentials && credentials !== this.credentials) {
139+
this.selectCredentials(credentials);
140+
this.credentials = credentials;
141+
}
142+
143+
if (Object.keys(updatedValues).length > 0) {
144+
submitForm();
139145
}
140146
}
141147
}

cypress/e2e/tests/administration/source-platform/crud.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ describe(["@tier2"], "CRUD operations on Cloud Foundry Source platform", () => {
5454
});
5555

5656
it.skip("Perform CRUD Tests on Cloud Foundry Source platform", function () {
57+
// TODO : Unskip tests once Infra ticket MTA-6241 is resolved
5758
const platform = new SourcePlatform(
5859
"CF-" + data.getRandomNumber(1, 200),
5960
"Cloud Foundry",
@@ -69,7 +70,7 @@ describe(["@tier2"], "CRUD operations on Cloud Foundry Source platform", () => {
6970
);
7071
exists(platform.name);
7172

72-
const newName = "CF-" + "updatedName" + data.getRandomNumber(1, 200);
73+
const newName = "CF-" + "updatedName" + data.getRandomNumber(1, 500);
7374
platform.edit({ name: newName });
7475
exists(newName);
7576

@@ -82,6 +83,11 @@ describe(["@tier2"], "CRUD operations on Cloud Foundry Source platform", () => {
8283
exists(newName);
8384

8485
platform.delete();
86+
checkSuccessAlert(
87+
successAlertMessage,
88+
`Success alert:Platform ${platform.name} was successfully deleted.`,
89+
true
90+
);
8591
notExists(platform.name);
8692
});
8793

0 commit comments

Comments
 (0)