Skip to content

Commit

Permalink
ASAP-293 Hide CTA footer for inactive interest groups (#4197)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabiayako authored Mar 11, 2024
1 parent e299a6d commit 0dae943
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const InterestGroupProfileAbout: React.FC<InterestGroupProfileAboutProps> = ({
/>
</div>
</div>
{contactEmails.length !== 0 && (
{contactEmails.length !== 0 && active && (
<CtaCard
href={createMailTo(contactEmails)}
buttonText="Contact PM"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,29 @@ it('does not render a call to action button, when a PM is NOT defined on the gro
expect(queryByText(/contact pm/i)).not.toBeInTheDocument();
});

it('does not render a call to action button, when a PM is defined but group is inactive', () => {
const { queryByText } = render(
<InterestGroupProfileAbout
{...props}
active={false}
contactEmails={[]}
leaders={[
{
user: {
...createUserResponse(),
displayName: 'John',
teams: [],
email: '[email protected]',
},
role: 'Project Manager',
},
]}
/>,
);

expect(queryByText(/contact pm/i)).not.toBeInTheDocument();
});

it('renders the Teams Tabbed card', () => {
render(<InterestGroupProfileAbout {...props} active={true} />);
expect(
Expand Down

0 comments on commit 0dae943

Please sign in to comment.