fix(editor): Add disabled state with tooltip on project creation buttons if user lacks permission (#13867)

This commit is contained in:
Guillaume Jacquart
2025-03-12 16:14:02 +01:00
committed by GitHub
parent c7bcdc544d
commit e33d0d7466
6 changed files with 85 additions and 26 deletions

View File

@@ -195,4 +195,22 @@ describe('ProjectsNavigation', () => {
expect(getByTestId('project-plus-button')).toBeVisible();
expect(getByTestId('add-first-project-button')).toBeVisible();
});
it('should show project plus button and add first project button in disabled state if user does not have permission', async () => {
projectsStore.teamProjectsLimit = -1;
projectsStore.hasPermissionToCreateProjects = false;
const { getByTestId } = renderComponent({
props: {
collapsed: false,
},
});
const plusButton = getByTestId('project-plus-button');
const addFirstProjectButton = getByTestId('add-first-project-button');
expect(plusButton).toBeVisible();
expect(plusButton).toBeDisabled();
expect(addFirstProjectButton).toBeVisible();
expect(addFirstProjectButton).toBeDisabled();
});
});