Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix from chatgpt for promise failure #39295

Merged
merged 2 commits into from
Feb 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,19 @@ describe("Slug URLs", { tags: ["@tag.AppUrl"] }, () => {

it("4. Checks redirect url", () => {
cy.url().then((url) => {
homePage.Signout(true);
const redirectUrl = `${url}?embed=true&a=b`;
cy.stub(agHelper, "VisitNAssert").as("visitStub");

// Call your function that handles redirection
agHelper.VisitNAssert(redirectUrl);
agHelper.AssertURL(`?redirectUrl=${encodeURIComponent(redirectUrl)}`);

// Assert that the stubbed function was called with the correct redirectUrl
cy.get("@visitStub").should("have.been.calledWith", redirectUrl);
cy.wrap(redirectUrl).then((redirectUrl) => {
const encodedRedirectUrl = `?redirectUrl=${encodeURIComponent(redirectUrl)}`;
cy.log(encodedRedirectUrl);
agHelper.AssertURL(encodedRedirectUrl);
});
});
});
});
Loading