Skip to content

Commit

Permalink
fixup! 🚑️(teams) do not diplay add button when disallowed
Browse files Browse the repository at this point in the history
  • Loading branch information
qbey committed Jan 30, 2025
1 parent a483595 commit 4953c0e
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import fetchMock from 'fetch-mock';

import { useAuthStore } from '@/core/auth';
import { AppWrapper } from '@/tests/utils';

import { Panel } from '../components/Panel';
Expand All @@ -23,6 +24,19 @@ describe('PanelTeams', () => {
});

it('renders with no team to display', async () => {
useAuthStore.setState({
userData: {
id: '1',
email: '[email protected]',
name: 'Test User',
abilities: {
teams: { can_view: true, can_create: true },
mailboxes: { can_view: true },
contacts: { can_view: true },
},
},
});

fetchMock.mock(`end:/teams/?ordering=-created_at`, []);

render(<TeamList />, { wrapper: AppWrapper });
Expand Down

0 comments on commit 4953c0e

Please sign in to comment.