Skip to content

Commit

Permalink
Reverted the change
Browse files Browse the repository at this point in the history
  • Loading branch information
sagar-qa007 committed Oct 1, 2024
1 parent c002b1a commit d0d6d3c
Showing 1 changed file with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,11 @@ describe("Tests fetch calls", { tags: ["@tag.JS"] }, () => {
propPane.TypeTextIntoField("Label", "getUserID");
propPane.EnterJSContext(
"onClick",
`{{(async () => {
try {
const response = await fetch('http://host.docker.internal:5001/v1/mock-api?records=1');
const json = await response.json();
const user = json[0]; // Get the first record
await storeValue('userId', user.id);
showAlert("UserId: " + appsmith.store.userId);
} catch (error) {
showAlert("Failed to fetch user data.");
}
})()}}`,
`{{fetch('https://jsonplaceholder.typicode.com/todos/1')
.then(res => res.json())
.then(json => storeValue('userId', json.userId))
.then(() => showAlert("UserId: " + appsmith.store.userId))}}`,
);

agHelper.Sleep(2000);
agHelper.ClickButton("getUserID");
agHelper.AssertContains("UserId: 1", "exist");
Expand Down

0 comments on commit d0d6d3c

Please sign in to comment.