Skip to content
Snippets Groups Projects
Unverified Commit ea5aacdc authored by Diogo Mendes's avatar Diogo Mendes Committed by GitHub
Browse files

Refactor Test to use API Call (#20491)


* Creating reproduction for 20442 + some refactor

* Skipping while waits for fix

* Remove skip

* Fix

* Resolving as requested

* Removing unneeded check

* Update frontend/test/metabase/scenarios/admin/settings/sso/google.cy.spec.js

Co-authored-by: default avatarNemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>

* Remove unneded reload

* Adding assertion

Co-authored-by: default avatarNemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
parent 7d58b946
No related branches found
No related tags found
No related merge requests found
......@@ -11,37 +11,35 @@ describe("scenarios > admin > settings > SSO > Google", () => {
cy.findByLabelText("Client ID").type(
"fake-client-id.apps.googleusercontent.com",
);
saveSettings();
cy.findByText("Success");
successfullySaveSettings();
cy.reload();
cy.findByDisplayValue("fake-client-id.apps.googleusercontent.com").type(
"fake-client-id2.apps.googleusercontent.com",
);
saveSettings();
cy.findByText("Success");
cy.findByDisplayValue("fake-client-id.apps.googleusercontent.com")
.clear()
.type("fake-client-id2.apps.googleusercontent.com");
successfullySaveSettings();
});
it("Remove Google Sing-In Setup (metabase#20442)", () => {
cy.findByLabelText("Client ID").type("example.apps.googleusercontent.com");
cy.findByLabelText("Domain").type("example.test");
saveSettings();
cy.findByText("Success");
cy.reload();
cy.request("PUT", "/api/setting", {
"google-auth-client-id": "example.apps.googleusercontent.com",
"google-auth-auto-create-accounts-domain": "example.test",
});
cy.visit("/admin/settings/authentication/google");
cy.findByLabelText("Client ID").clear();
cy.findByLabelText("Domain").clear();
saveSettings();
cy.findByText("Success");
successfullySaveSettings();
});
it("Google sign-in client ID form should show an error message if it does not end with the correct suffix (metabase#15975)", () => {
cy.findByLabelText("Client ID").type("fake-client-id");
saveSettings();
cy.button("Save changes").click();
cy.findByText(
'Invalid Google Sign-In Client ID: must end with ".apps.googleusercontent.com"',
);
});
});
function saveSettings() {
function successfullySaveSettings() {
cy.button("Save changes").click();
cy.findByText("Success");
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment