Skip to content

Commit

Permalink
Update React and other deps
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjmcgrath committed Apr 4, 2022
1 parent 46311bf commit 68e47ac
Show file tree
Hide file tree
Showing 8 changed files with 13,204 additions and 18,608 deletions.
18 changes: 11 additions & 7 deletions __tests__/helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ export const createWrapper = ({
clientId = '__test_client_id__',
domain = '__test_domain__',
...opts
}: Partial<Auth0ClientOptions> = {}) => ({
children,
}: PropsWithChildren<{}>): JSX.Element => (
<Auth0Provider domain={domain} clientId={clientId} {...opts}>
{children}
</Auth0Provider>
);
}: Partial<Auth0ClientOptions> = {}) => {
return function Wrapper({
children,
}: PropsWithChildren<Record<string, unknown>>): JSX.Element {
return (
<Auth0Provider domain={domain} clientId={clientId} {...opts}>
{children}
</Auth0Provider>
);
};
};
16 changes: 12 additions & 4 deletions __tests__/with-authentication-required.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ describe('withAuthenticationRequired', () => {
await waitFor(() =>
expect(mockClient.loginWithRedirect).not.toHaveBeenCalled()
);
expect(screen.getByText('Private')).toBeInTheDocument();
await waitFor(() =>
expect(screen.getByText('Private')).toBeInTheDocument()
);
});

it('should not allow access to claims-restricted components', async () => {
Expand Down Expand Up @@ -93,11 +95,15 @@ describe('withAuthenticationRequired', () => {
await waitFor(() =>
expect(mockClient.loginWithRedirect).not.toHaveBeenCalled()
);
expect(screen.getByText('Private')).toBeInTheDocument();
await waitFor(() =>
expect(screen.getByText('Private')).toBeInTheDocument()
);
});

it('should show a custom redirecting message', async () => {
mockClient.getUser.mockResolvedValue({ name: '__test_user__' });
mockClient.getUser.mockResolvedValue(
Promise.resolve({ name: '__test_user__' })
);
const MyComponent = (): JSX.Element => <>Private</>;
const OnRedirecting = (): JSX.Element => <>Redirecting</>;
const WrappedComponent = withAuthenticationRequired(MyComponent, {
Expand All @@ -114,7 +120,9 @@ describe('withAuthenticationRequired', () => {
await waitFor(() =>
expect(mockClient.loginWithRedirect).not.toHaveBeenCalled()
);
expect(screen.queryByText('Redirecting')).not.toBeInTheDocument();
await waitFor(() =>
expect(screen.queryByText('Redirecting')).not.toBeInTheDocument()
);
});

it('should pass additional options on to loginWithRedirect', async () => {
Expand Down
21 changes: 10 additions & 11 deletions examples/gatsby-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,21 @@
"version": "0.1.0",
"dependencies": {
"@auth0/auth0-react": "file:../..",
"bootstrap": "^4.5.0",
"gatsby": "^2.22.15",
"bootstrap": "^5.1.3",
"gatsby": "^4.11.1",
"gatsby-image": "^2.4.5",
"gatsby-plugin-create-client-paths": "^2.3.4",
"gatsby-plugin-manifest": "^2.4.9",
"gatsby-plugin-offline": "^3.2.7",
"gatsby-plugin-react-helmet": "^3.3.2",
"gatsby-source-filesystem": "^2.3.8",
"gatsby-transformer-sharp": "^2.5.3",
"prop-types": "^15.7.2",
"gatsby-plugin-manifest": "^4.11.1",
"gatsby-plugin-offline": "^5.11.1",
"gatsby-plugin-react-helmet": "^5.11.0",
"gatsby-source-filesystem": "^4.11.1",
"gatsby-transformer-sharp": "^4.11.0",
"prop-types": "^15.8.1",
"react": "file:../../node_modules/react",
"react-dom": "file:../../node_modules/react-dom",
"react-helmet": "^6.0.0"
"react-helmet": "^6.1.0"
},
"devDependencies": {
"prettier": "2.0.5"
"prettier": "2.6.2"
},
"keywords": [
"gatsby"
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"dependencies": {
"@auth0/auth0-react": "file:../..",
"next": "9.4.4",
"next": "^12.1.4",
"react": "file:../../node_modules/react",
"react-dom": "file:../../node_modules/react-dom"
}
Expand Down
Loading

0 comments on commit 68e47ac

Please sign in to comment.