Skip to content

Commit

Permalink
Merge pull request #414 from openedx/kiram15/ENT-9448
Browse files Browse the repository at this point in the history
fix: add integration count number
  • Loading branch information
kiram15 authored Sep 9, 2024
2 parents 7ed6959 + bce476d commit c6ed509
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ const CustomerIntegrations = ({
const { ADMIN_PORTAL_BASE_URL } = getConfig();
const ssoDateText = ({ sso }) => (`Created ${formatDate(sso?.created)} • Last modified ${formatDate(sso?.modifed)}`);
const configDateText = ({ config }) => (`Created ${formatDate(config?.created)} • Last modified ${formatDate(config?.lastModifiedAt)}`);
let integrationCount = (activeSSO ? activeSSO.length : 0) + (activeIntegrations ? activeIntegrations.length : 0);
if (apiCredentialsEnabled) {
integrationCount++;
}

return (
<div>
{(activeSSO || activeIntegrations || apiCredentialsEnabled) && (
{(integrationCount > 0) && (
<div>
<h2>Associated integrations</h2>
<h2>Associated integrations ({integrationCount})</h2>
<hr />
{activeSSO && activeSSO.map((sso) => (
<CustomerViewCard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ describe('CustomerViewIntegrations', () => {
</IntlProvider>,
);
await waitFor(() => {
expect(screen.getByText('Associated integrations')).toBeInTheDocument();

expect(screen.getByText('Associated integrations (4)')).toBeInTheDocument();
expect(screen.getByText('SSO')).toBeInTheDocument();
expect(screen.getByText('Orange cats rule')).toBeInTheDocument();
expect(screen.getAllByText('Created September 15, 2024 • Last modified September 15, 2024')).toHaveLength(3);
Expand Down

0 comments on commit c6ed509

Please sign in to comment.