Skip to content

Commit

Permalink
Fix issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbouder committed Dec 17, 2024
1 parent 748ceca commit 5203e7f
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/components/header/header.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { act, fireEvent, render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { BrowserRouter } from 'react-router-dom';

import { AuthProvider } from 'react-oidc-context';
import { Provider } from 'jotai';
import { AuthProvider } from 'react-oidc-context';
import * as useAuthMock from '../../hooks/use-auth';
import { User } from '../../types/user';
import { Header } from './header';
Expand Down
2 changes: 1 addition & 1 deletion src/components/protected-route/protected-route.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { User } from '@src/types/user';
import { act, render } from '@testing-library/react';
import { Provider } from 'jotai';
import { AuthProvider } from 'react-oidc-context';
import { BrowserRouter } from 'react-router-dom';
import { Provider } from 'jotai';
import * as useAuthMock from '../../hooks/use-auth';
import { ProtectedRoute } from './protected-route';

Expand Down
2 changes: 1 addition & 1 deletion src/hooks/use-auth.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import keycloak from '@src/utils/keycloak';
import { act, renderHook } from '@testing-library/react';
import { AuthProvider } from 'react-oidc-context';
import { Provider } from 'jotai';
import { AuthProvider } from 'react-oidc-context';
import useAuth from './use-auth';

interface ContextWrapperProps {
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/use-auth.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getSignInRedirectUrl } from '@src/utils/auth';
import { useAtom } from 'jotai';
import { useEffect, useState } from 'react';
import { useAuth as useKeycloakAuth } from 'react-oidc-context';
import { useAtom } from 'jotai';
import { userData } from '../data/user';
import { currentUserState, signedInState } from '../store';
import { User } from '../types/user';
Expand Down
2 changes: 1 addition & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Provider } from 'jotai';
import React from 'react';
import ReactDOM from 'react-dom/client';
import { AuthProvider } from 'react-oidc-context';
import { BrowserRouter } from 'react-router-dom';
import { Provider } from 'jotai';
import { App } from './App.tsx';
import './styles.scss';
import keycloak from './utils/keycloak.ts';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { mockData } from '@src/data/spacecraft';
import { act, render } from '@testing-library/react';
import { BrowserRouter } from 'react-router-dom';
import { Provider } from 'jotai';
import { BrowserRouter } from 'react-router-dom';
import { DashboardBarChart } from './dashboard-bar-chart';

describe('DashboardBarChart', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { mockData } from '@src/data/spacecraft';
import { act, render } from '@testing-library/react';
import { BrowserRouter } from 'react-router-dom';
import { Provider } from 'jotai';
import { BrowserRouter } from 'react-router-dom';
import { DashboardPieChart } from './dashboard-pie-chart';

describe('DashboardPieChart', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { mockData } from '@src/data/spacecraft';
import { act, render } from '@testing-library/react';
import { BrowserRouter } from 'react-router-dom';
import { Provider } from 'jotai';
import { BrowserRouter } from 'react-router-dom';
import { DashboardTable } from './dashboard-table';

describe('DashboardTable', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/dashboard/dashboard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import axios from '@src/utils/axios';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { act, render } from '@testing-library/react';
import MockAdapter from 'axios-mock-adapter';
import { Provider } from 'jotai';
import { AuthProvider } from 'react-oidc-context';
import { BrowserRouter } from 'react-router-dom';
import { Provider } from 'jotai';
import * as useAuthMock from '../../hooks/use-auth';
import { User } from '../../types/user';
import { Dashboard } from './dashboard';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/details/details.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import axios from '@src/utils/axios';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { render, waitFor } from '@testing-library/react';
import MockAdapter from 'axios-mock-adapter';
import { Provider } from 'jotai';
import { AuthProvider } from 'react-oidc-context';
import { BrowserRouter } from 'react-router-dom';
import { Provider } from 'jotai';
import * as useAuthMock from '../../hooks/use-auth';
import { User } from '../../types/user';
import { Details } from './details';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/home.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { act, render } from '@testing-library/react';
import { Provider } from 'jotai';
import { AuthProvider } from 'react-oidc-context';
import { BrowserRouter } from 'react-router-dom';
import { Provider } from 'jotai';
import * as useAuthMock from '../../hooks/use-auth';
import { User } from '../../types/user';
import { Home } from './home';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/search-results/search-results.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import axios from '@src/utils/axios';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { act, render } from '@testing-library/react';
import MockAdapter from 'axios-mock-adapter';
import { Provider } from 'jotai';
import { AuthProvider } from 'react-oidc-context';
import { BrowserRouter } from 'react-router-dom';
import { Provider } from 'jotai';
import * as useAuthMock from '../../hooks/use-auth';
import { SearchResults } from './search-results';

Expand Down
2 changes: 1 addition & 1 deletion src/pages/sign-in/sign-in.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { act, render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { BrowserRouter } from 'react-router-dom';

import { AuthProvider } from 'react-oidc-context';
import { Provider } from 'jotai';
import { AuthProvider } from 'react-oidc-context';
import * as useAuthMock from '../../hooks/use-auth';
import { User } from '../../types/user';
import { SignIn } from './sign-in';
Expand Down
11 changes: 2 additions & 9 deletions src/store.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import { User } from '@src/types/user';
import { atom } from 'jotai';

const signedInState = atom({
key: 'signedIn',
default: false,
});

const currentUserState = atom<User | undefined>({
key: 'currentUser',
default: undefined,
});
const signedInState = atom<boolean>(false);
const currentUserState = atom<User | undefined>(undefined);

export { currentUserState, signedInState };

0 comments on commit 5203e7f

Please sign in to comment.