[MM-58840] Add routing restrictions (#27482)

Этот коммит содержится в:
Julien Tant
2024-07-01 11:05:38 -07:00
коммит произвёл GitHub
родитель 6bfd309573
Коммит d0c4e820a4
4 изменённых файлов: 35 добавлений и 7 удалений

Просмотреть файл

@@ -55,6 +55,14 @@ describe('group configuration', () => {
});
});
it("MM-58840 Groups - can't navigate to invalid URL", () => {
// # Visit the invalid URL.
cy.visit('/admin_console/user_management/groups/invalid');
// * Verify that the user is seeing the listing (subroute not matched)
cy.findByText('AD/LDAP Groups').should('be.visible');
});
describe('adding a team', () => {
it('does not add a team without saving', () => {
addGroupSyncable('team', () => {

Просмотреть файл

@@ -41,6 +41,14 @@ describe('Team members test', () => {
});
});
it("MM-58840 Teams - can't navigate to invalid URL", () => {
// # Visit the invalid URL.
cy.visit('/admin_console/user_management/teams/invalid');
// * Verify that the user is seeing the listing (subroute not matched)
cy.findByText('Mattermost Teams').should('be.visible');
});
it('MM-23938 - Team members block is only visible when team is not group synced', () => {
// # Visit the team page
cy.visit(`/admin_console/user_management/teams/${testTeam.id}`);

Просмотреть файл

@@ -222,6 +222,17 @@ describe('User Management', () => {
cy.url().should('contain', '/login');
});
it("MM-58840 Users - can't navigate to invalid URL", () => {
// # Login as sysadmin.
cy.apiLogin(sysadmin);
// # Visit the invalid URL.
cy.visit('/admin_console/user_management/user/invalid');
// * Verify that the user is redirected to the default page.
cy.url().should('include', '/admin_console/about/license');
});
function resetUserEmail(oldEmail, newEmail, errorMsg) {
cy.visit('/admin_console/user_management/users');