Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Fix spacing of headings of integration manager on General settings tab #10232

Merged
merged 12 commits into from
Apr 5, 2023
Merged
64 changes: 64 additions & 0 deletions cypress/e2e/settings/set-integration-manager.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
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.
*/

/// <reference types="cypress" />

import { HomeserverInstance } from "../../plugins/utils/homeserver";

const USER_NAME = "Alice";

describe("Set integration manager on General settings tab", () => {
let homeserver: HomeserverInstance;

beforeEach(() => {
cy.startHomeserver("default").then((data) => {
homeserver = data;
cy.initTestUser(homeserver, USER_NAME);
});
});

afterEach(() => {
cy.stopHomeserver(homeserver);
});

it("should set integration manager", () => {
cy.openUserSettings("General");
cy.contains("Manage integrations").should("exist");

// Make sure integration manager's toggle switch is enabled
cy.get(".mx_SetIntegrationManager .mx_ToggleSwitch_enabled").should("exist");

// Check the default margin set to mx_SettingsTab_heading on the settings tab
cy.get(".mx_SettingsTab > .mx_SettingsTab_heading").should("have.css", "margin-right", "100px");
luixxiul marked this conversation as resolved.
Show resolved Hide resolved

// Make sure the space between "Manage integrations" and the integration server address is set to 4px;
cy.get(".mx_SettingsTab .mx_SetIntegrationManager_heading_manager > .mx_SettingsTab_heading").should(
"have.css",
"margin-inline-end",
"0px",
);
cy.get(".mx_SettingsTab .mx_SetIntegrationManager_heading_manager > .mx_SettingsTab_subheading").should(
"have.css",
"margin-inline-end",
"0px",
);
cy.get(".mx_SettingsTab .mx_SetIntegrationManager_heading_manager").should("have.css", "column-gap", "4px");

cy.get(".mx_SettingsTab .mx_SetIntegrationManager_heading_manager").percySnapshotElement(
"'Manage integrations' on General settings tab",
);
});
});
1 change: 1 addition & 0 deletions res/css/views/settings/_SetIntegrationManager.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
}
}

Expand Down