mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 11:01:15 +00:00
fix(editor): Follow-up fixes to projects side menu (#11327)
This commit is contained in:
@@ -147,7 +147,8 @@ describe('ProjectsNavigation', () => {
|
||||
expect(uiStore.goToUpgrade).toHaveBeenCalledWith('rbac', 'upgrade-rbac');
|
||||
});
|
||||
|
||||
it('should show "Projects" title and projects if the user has access to any team project', async () => {
|
||||
it('should show "Projects" title and Personal project when the feature is enabled', async () => {
|
||||
projectsStore.isTeamProjectFeatureEnabled = true;
|
||||
projectsStore.myProjects = [...personalProjects, ...teamProjects];
|
||||
|
||||
const { getByRole, getAllByTestId, getByTestId } = renderComponent({
|
||||
@@ -158,11 +159,12 @@ describe('ProjectsNavigation', () => {
|
||||
|
||||
expect(getByRole('heading', { level: 3, name: 'Projects' })).toBeVisible();
|
||||
expect(getByTestId('project-personal-menu-item')).toBeVisible();
|
||||
expect(getByTestId('project-personal-menu-item').querySelector('svg')).toBeVisible();
|
||||
expect(getAllByTestId('project-menu-item')).toHaveLength(teamProjects.length);
|
||||
});
|
||||
|
||||
it('should not show "Projects" title when the menu is collapsed', async () => {
|
||||
projectsStore.myProjects = [...personalProjects, ...teamProjects];
|
||||
projectsStore.isTeamProjectFeatureEnabled = true;
|
||||
|
||||
const { queryByRole } = renderComponent({
|
||||
props: {
|
||||
@@ -173,8 +175,8 @@ describe('ProjectsNavigation', () => {
|
||||
expect(queryByRole('heading', { level: 3, name: 'Projects' })).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('should not show "Projects" title when there are no available projects', async () => {
|
||||
projectsStore.myProjects = [];
|
||||
it('should not show "Projects" title when the feature is not enabled', async () => {
|
||||
projectsStore.isTeamProjectFeatureEnabled = false;
|
||||
|
||||
const { queryByRole } = renderComponent({
|
||||
props: {
|
||||
@@ -184,4 +186,17 @@ describe('ProjectsNavigation', () => {
|
||||
|
||||
expect(queryByRole('heading', { level: 3, name: 'Projects' })).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('should not show project icons when the menu is collapsed', async () => {
|
||||
projectsStore.isTeamProjectFeatureEnabled = true;
|
||||
|
||||
const { getByTestId } = renderComponent({
|
||||
props: {
|
||||
collapsed: true,
|
||||
},
|
||||
});
|
||||
|
||||
expect(getByTestId('project-personal-menu-item')).toBeVisible();
|
||||
expect(getByTestId('project-personal-menu-item').querySelector('svg')).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user