2023-04-27 20:11:48 +02:00
|
|
|
/*
|
|
|
|
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";
|
|
|
|
|
|
|
|
describe("Preferences user settings tab", () => {
|
|
|
|
let homeserver: HomeserverInstance;
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
cy.startHomeserver("default").then((data) => {
|
|
|
|
homeserver = data;
|
|
|
|
cy.initTestUser(homeserver, "Bob");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
afterEach(() => {
|
|
|
|
cy.stopHomeserver(homeserver);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should be rendered properly", () => {
|
|
|
|
cy.openUserSettings("Preferences");
|
|
|
|
|
2023-05-17 03:16:49 +02:00
|
|
|
cy.findByTestId("mx_PreferencesUserSettingsTab").within(() => {
|
2023-04-27 20:11:48 +02:00
|
|
|
// Assert that the top heading is rendered
|
2023-05-17 03:16:49 +02:00
|
|
|
cy.contains("Preferences").should("be.visible");
|
2023-04-27 20:11:48 +02:00
|
|
|
});
|
|
|
|
|
2023-05-17 03:16:49 +02:00
|
|
|
cy.findByTestId("mx_PreferencesUserSettingsTab").percySnapshotElement("User settings tab - Preferences", {
|
|
|
|
// Emulate TabbedView's actual min and max widths
|
|
|
|
// 580: '.mx_UserSettingsDialog .mx_TabbedView' min-width
|
|
|
|
// 796: 1036 (mx_TabbedView_tabsOnLeft actual width) - 240 (mx_TabbedView_tabPanel margin-right)
|
|
|
|
widths: [580, 796],
|
|
|
|
});
|
2023-04-27 20:11:48 +02:00
|
|
|
});
|
|
|
|
});
|