-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1009 from CruGlobal/8089-setup-connect-page
[MPDX-8089] Add setup connect page
- Loading branch information
Showing
12 changed files
with
1,137 additions
and
770 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
Oops, something went wrong.