Skip to content

Commit

Permalink
Merge pull request #1009 from CruGlobal/8089-setup-connect-page
Browse files Browse the repository at this point in the history
[MPDX-8089] Add setup connect page
  • Loading branch information
canac authored Aug 28, 2024
2 parents d4b7518 + 2490da9 commit ec9c73f
Show file tree
Hide file tree
Showing 12 changed files with 1,137 additions and 770 deletions.
29 changes: 29 additions & 0 deletions pages/setup/connect.page.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { render } from '@testing-library/react';
import { SnackbarProvider } from 'notistack';
import TestRouter from '__tests__/util/TestRouter';
import { GqlMockedProvider } from '__tests__/util/graphqlMocking';
import Connect from './connect.page';

const push = jest.fn();
const router = {
push,
};

describe('Setup connect page', () => {
it('renders', async () => {
const mutationSpy = jest.fn();
const { findByRole } = render(
<TestRouter router={router}>
<SnackbarProvider>
<GqlMockedProvider onCall={mutationSpy}>
<Connect />
</GqlMockedProvider>
</SnackbarProvider>
</TestRouter>,
);

expect(
await findByRole('heading', { name: "It's time for awesome!" }),
).toBeInTheDocument();
});
});
28 changes: 28 additions & 0 deletions pages/setup/connect.page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import Head from 'next/head';
import React, { ReactElement } from 'react';
import { useTranslation } from 'react-i18next';
import { Connect } from 'src/components/Setup/Connect';
import useGetAppSettings from 'src/hooks/useGetAppSettings';
import { loadSession } from '../api/utils/pagePropsHelpers';

// This is the second page of the setup tour. It lets users connect to organizations. It will be shown if the user
// doesn't have any organization accounts attached to their user or account lists.
const ConnectPage = (): ReactElement => {
const { t } = useTranslation();
const { appName } = useGetAppSettings();

return (
<>
<Head>
<title>
{appName} | {t('Setup - Get Connected')}
</title>
</Head>
<Connect />
</>
);
};

export const getServerSideProps = loadSession;

export default ConnectPage;
Loading

0 comments on commit ec9c73f

Please sign in to comment.