From 7503bf6b967ba2d37e1f10d988b693fa5fe5ac75 Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Wed, 5 Apr 2023 07:13:32 +0000 Subject: [PATCH] Fix spacing of headings of integration manager on General settings tab (#10232) * Fix spacing of headings of integration manager on General settings tab Signed-off-by: Suguru Hirahara * lint Signed-off-by: Suguru Hirahara * Check the column gap Signed-off-by: Suguru Hirahara * Iterate Signed-off-by: Suguru Hirahara * Scroll to 'mx_SetIntegrationManager' and take a snapshot of the dialog Signed-off-by: Suguru Hirahara * Revert "Scroll to 'mx_SetIntegrationManager' and take a snapshot of the dialog" This reverts commit 9151d6a34de109c0dffa95046397c13f4b61f5a4. * Specify actual width of mx_SetIntegrationManager Signed-off-by: Suguru Hirahara --------- Signed-off-by: Suguru Hirahara --- .../settings/set-integration-manager.spec.ts | 60 +++++++++++++++++++ .../settings/_SetIntegrationManager.pcss | 1 + 2 files changed, 61 insertions(+) create mode 100644 cypress/e2e/settings/set-integration-manager.spec.ts diff --git a/cypress/e2e/settings/set-integration-manager.spec.ts b/cypress/e2e/settings/set-integration-manager.spec.ts new file mode 100644 index 0000000000..5798157394 --- /dev/null +++ b/cypress/e2e/settings/set-integration-manager.spec.ts @@ -0,0 +1,60 @@ +/* +Copyright 2023 Suguru Hirahara + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +/// + +import { HomeserverInstance } from "../../plugins/utils/homeserver"; + +const USER_NAME = "Alice"; + +describe("Set integration manager", () => { + let homeserver: HomeserverInstance; + + beforeEach(() => { + cy.startHomeserver("default").then((data) => { + homeserver = data; + cy.initTestUser(homeserver, USER_NAME); + }); + }); + + afterEach(() => { + cy.stopHomeserver(homeserver); + }); + + it("should be correctly rendered", () => { + cy.openUserSettings("General"); + + cy.get(".mx_SetIntegrationManager").within(() => { + // Assert the toggle switch is enabled by default + cy.get(".mx_ToggleSwitch_enabled").should("exist"); + + // Assert space between "Manage integrations" and the integration server address is set to 4px; + cy.get(".mx_SetIntegrationManager_heading_manager").should("have.css", "column-gap", "4px"); + + cy.get(".mx_SetIntegrationManager_heading_manager").within(() => { + cy.get(".mx_SettingsTab_heading").should("have.text", "Manage integrations"); + + // Assert the headings' inline end margin values are set to zero in favor of the column-gap declaration + cy.get(".mx_SettingsTab_heading").should("have.css", "margin-inline-end", "0px"); + cy.get(".mx_SettingsTab_subheading").should("have.css", "margin-inline-end", "0px"); + }); + }); + + cy.get(".mx_SetIntegrationManager").percySnapshotElement("'Manage integrations' on General settings tab", { + widths: [692], // actual width of mx_SetIntegrationManager + }); + }); +}); diff --git a/res/css/views/settings/_SetIntegrationManager.pcss b/res/css/views/settings/_SetIntegrationManager.pcss index c6b5d9283b..30feddb043 100644 --- a/res/css/views/settings/_SetIntegrationManager.pcss +++ b/res/css/views/settings/_SetIntegrationManager.pcss @@ -29,6 +29,7 @@ limitations under the License. .mx_SettingsTab_subheading { margin-top: 0; margin-bottom: 0; + margin-inline-end: 0; /* Cancel the default right (inline-end) margin */ } }