|
| 1 | +/* |
| 2 | +Copyright 2023 Suguru Hirahara |
| 3 | +
|
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. |
| 6 | +You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +See the License for the specific language governing permissions and |
| 14 | +limitations under the License. |
| 15 | +*/ |
| 16 | + |
| 17 | +/// <reference types="cypress" /> |
| 18 | + |
| 19 | +import { HomeserverInstance } from "../../plugins/utils/homeserver"; |
| 20 | + |
| 21 | +const USER_NAME = "Alice"; |
| 22 | + |
| 23 | +describe("Set integration manager", () => { |
| 24 | + let homeserver: HomeserverInstance; |
| 25 | + |
| 26 | + beforeEach(() => { |
| 27 | + cy.startHomeserver("default").then((data) => { |
| 28 | + homeserver = data; |
| 29 | + cy.initTestUser(homeserver, USER_NAME); |
| 30 | + }); |
| 31 | + }); |
| 32 | + |
| 33 | + afterEach(() => { |
| 34 | + cy.stopHomeserver(homeserver); |
| 35 | + }); |
| 36 | + |
| 37 | + it("should be correctly rendered", () => { |
| 38 | + cy.openUserSettings("General"); |
| 39 | + |
| 40 | + cy.get(".mx_SetIntegrationManager").within(() => { |
| 41 | + // Assert the toggle switch is enabled by default |
| 42 | + cy.get(".mx_ToggleSwitch_enabled").should("exist"); |
| 43 | + |
| 44 | + // Assert space between "Manage integrations" and the integration server address is set to 4px; |
| 45 | + cy.get(".mx_SetIntegrationManager_heading_manager").should("have.css", "column-gap", "4px"); |
| 46 | + |
| 47 | + cy.get(".mx_SetIntegrationManager_heading_manager").within(() => { |
| 48 | + cy.get(".mx_SettingsTab_heading").should("have.text", "Manage integrations"); |
| 49 | + |
| 50 | + // Assert the headings' inline end margin values are set to zero in favor of the column-gap declaration |
| 51 | + cy.get(".mx_SettingsTab_heading").should("have.css", "margin-inline-end", "0px"); |
| 52 | + cy.get(".mx_SettingsTab_subheading").should("have.css", "margin-inline-end", "0px"); |
| 53 | + }); |
| 54 | + }); |
| 55 | + |
| 56 | + cy.get(".mx_SetIntegrationManager").percySnapshotElement("'Manage integrations' on General settings tab", { |
| 57 | + widths: [692], // actual width of mx_SetIntegrationManager |
| 58 | + }); |
| 59 | + }); |
| 60 | +}); |
0 commit comments