Skip to content
Snippets Groups Projects
Unverified Commit 6c9dbd7b authored by Alexander Polyankin's avatar Alexander Polyankin Committed by GitHub
Browse files

Add a test that the app works for all available-locales (#22315)

parent db52a130
Branches
Tags
No related merge requests found
// Migrated from frontend/test/metabase/user/UserSettings.integ.spec.js
import { restore, popover } from "__support__/e2e/cypress";
import { USERS } from "__support__/e2e/cypress_data";
const { first_name, last_name, email, password } = USERS.normal;
const CURRENT_USER = {
......@@ -98,9 +99,7 @@ describe("user > settings", () => {
cy.visit("/account/profile");
cy.findByText("Use site default").click();
popover()
.contains("Indonesian")
.click();
popover().within(() => cy.findByText("Indonesian").click());
cy.button("Update").click();
cy.wait("@updateUserSettings");
......@@ -109,6 +108,24 @@ describe("user > settings", () => {
cy.icon("gear").should("exist");
});
it("should be able to open the app with every locale from the available locales (metabase#22192)", () => {
cy.request("GET", "/api/user/current").then(({ body: user }) => {
cy.intercept("GET", "/api/user/current").as("getUser");
cy.request("GET", "/api/session/properties").then(
({ body: settings }) => {
cy.wrap(settings["available-locales"]).each(([locale]) => {
cy.log(`Using ${locale} locale`);
cy.request("PUT", `/api/user/${user.id}`, { locale });
cy.visit("/");
cy.wait("@getUser");
cy.icon("gear").should("exist");
});
},
);
});
});
describe("when user is authenticated via ldap", () => {
beforeEach(() => {
cy.server();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment