Rename general user settings to account (#12841)

* Rename general user settings to account

Everything 'general' is now elsewhere, so this is ready for its
new name.

* Update snapshots

* Rename & update playwright test

* Rename class & remove unused CSS class

* Change test ID

* rethemendex

* More tests!!

* snapshots

* Put the screenshots back in the new place

* Fix tests with restoreAllMocks

* More screenshot renaming

* More test fixes & screenshot updates

* More test fixes

* un-skip

* Typo

Co-authored-by: Robin <robin@robin.town>

---------

Co-authored-by: Robin <robin@robin.town>
This commit is contained in:
David Baker 2024-08-06 18:05:08 +01:00 committed by GitHub
parent 1be4c12fd2
commit 4e4c5c7768
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 172 additions and 54 deletions

View file

@ -31,7 +31,7 @@ test.describe("OIDC Aware", () => {
await expect(page.getByRole("heading", { name: "Welcome alice", exact: true })).toBeVisible();
// Open settings and navigate to account management
await app.settings.openUserSettings("General");
await app.settings.openUserSettings("Account");
const newPagePromise = context.waitForEvent("page");
await page.getByRole("button", { name: "Manage account" }).click();

View file

@ -44,7 +44,7 @@ test.describe("OIDC Native", () => {
const deviceId = await page.evaluate<string>(() => window.localStorage.mx_device_id);
await app.settings.openUserSettings("General");
await app.settings.openUserSettings("Account");
const newPagePromise = context.waitForEvent("page");
await page.getByRole("button", { name: "Manage account" }).click();
await app.settings.closeDialog();

View file

@ -19,23 +19,23 @@ import { test, expect } from "../../element-web-test";
const USER_NAME = "Bob";
const USER_NAME_NEW = "Alice";
test.describe("General user settings tab", () => {
test.describe("Account user settings tab", () => {
test.use({
displayName: USER_NAME,
config: {
default_country_code: "US", // For checking the international country calling code
},
uut: async ({ app, user }, use) => {
const locator = await app.settings.openUserSettings("General");
const locator = await app.settings.openUserSettings("Account");
await use(locator);
},
});
test("should be rendered properly", async ({ uut, user }) => {
await expect(uut).toMatchScreenshot("general.png");
await expect(uut).toMatchScreenshot("account.png");
// Assert that the top heading is rendered
await expect(uut.getByRole("heading", { name: "General" })).toBeVisible();
await expect(uut.getByRole("heading", { name: "Account", exact: true })).toBeVisible();
const profile = uut.locator(".mx_UserProfileSettings_profile");
await profile.scrollIntoViewIfNeeded();
@ -49,12 +49,11 @@ test.describe("General user settings tab", () => {
await expect(uut.getByTestId("discoverySection").locator(".mx_Spinner")).not.toBeVisible();
const accountSection = uut.getByTestId("accountSection");
accountSection.scrollIntoViewIfNeeded();
// Assert that input areas for changing a password exists
const changePassword = accountSection.locator("form.mx_GeneralUserSettingsTab_section--account_changePassword");
await changePassword.scrollIntoViewIfNeeded();
await expect(changePassword.getByLabel("Current password")).toBeVisible();
await expect(changePassword.getByLabel("New Password")).toBeVisible();
await expect(changePassword.getByLabel("Confirm password")).toBeVisible();
await expect(accountSection.getByLabel("Current password")).toBeVisible();
await expect(accountSection.getByLabel("New Password")).toBeVisible();
await expect(accountSection.getByLabel("Confirm password")).toBeVisible();
// Check email addresses area
const emailAddresses = uut.getByTestId("mx_AccountEmailAddresses");
@ -82,13 +81,13 @@ test.describe("General user settings tab", () => {
test("should respond to small screen sizes", async ({ page, uut }) => {
await page.setViewportSize({ width: 700, height: 600 });
await expect(uut).toMatchScreenshot("general-smallscreen.png");
await expect(uut).toMatchScreenshot("account-smallscreen.png");
});
test("should show tooltips on narrow screen", async ({ page, uut }) => {
await page.setViewportSize({ width: 700, height: 600 });
await page.getByRole("tab", { name: "General" }).hover();
await expect(page.getByRole("tooltip")).toHaveText("General");
await page.getByRole("tab", { name: "Account" }).hover();
await expect(page.getByRole("tooltip")).toHaveText("Account");
});
test("should support adding and removing a profile picture", async ({ uut, page }) => {

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Before After
Before After