Skip to content

Commit

Permalink
chore(SILVA-403): code refactor (#444)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulushcgcj authored and jazzgrewal committed Nov 7, 2024
1 parent 3f0b8ca commit e833322
Show file tree
Hide file tree
Showing 50 changed files with 699 additions and 1,150 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info
-Dsonar.typescript.tsconfigPaths=tsconfig.json
-Dsonar.sources=src/
-Dsonar.exclusions=src/__test__/**
-Dsonar.exclusions=src/__test__/**,src/amplifyconfiguration.*,src/**/*.scss,src/**/*.css,src/**/*.d.*,src/setupTests.*
-Dsonar.tests=src/__test__/
-Dsonar.project.monorepo.enabled=true
sonar_token: ${{ secrets.SONAR_TOKEN_FRONTEND }}
Expand Down
76 changes: 3 additions & 73 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
"@carbon/icons-react": "^11.50.1",
"@carbon/pictograms-react": "^11.49.0",
"@carbon/react": "^1.27.0",
"@redux-devtools/extension": "^3.3.0",
"@tanstack/react-query": "^5.50.1",
"@types/node": "^22.0.0",
"@vitejs/plugin-react": "^4.0.4",
"@vitejs/plugin-react-swc": "^3.3.2",
"@vitejs/plugin-react-swc": "^3.3.2",
"aws-amplify": "^6.7.0",
"axios": "^1.6.8",
"jspdf": "^2.5.2",
Expand All @@ -26,10 +25,7 @@
"react-esri-leaflet": "^2.0.1",
"react-hash-string": "^1.0.0",
"react-leaflet": "^4.2.1",
"react-redux": "^9.0.0",
"react-router-dom": "^6.10.0",
"redux": "^5.0.0",
"redux-thunk": "^3.0.0",
"vite": "^5.0.0",
"vite-plugin-svgr": "^4.0.0",
"vite-tsconfig-paths": "^5.0.0",
Expand Down
5 changes: 0 additions & 5 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
import './custom.scss';
import Landing from "./screens/Landing";
import Help from "./screens/Help";
import SideLayout from './layouts/SideLayout';
import ProtectedRoute from './routes/ProtectedRoute';
import Opening from './screens/Opening';
Expand Down Expand Up @@ -33,10 +32,6 @@ const router = createBrowserRouter([
{
path: "/silviculture-search",
element: <SideLayout pageContent={<SilvicultureSearch />} />
},
{
path: "/help",
element: <SideLayout pageContent={<Help />} />
}
]
},
Expand Down
86 changes: 0 additions & 86 deletions frontend/src/__test__/actions/userAction.test.ts

This file was deleted.

22 changes: 4 additions & 18 deletions frontend/src/__test__/components/BCHeaderwSide.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ import { BrowserRouter } from 'react-router-dom';
import BCHeaderwSide from '../../components/BCHeaderwSide';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import {leftMenu } from '../../components/BCHeaderwSide/constants';
import * as redux from 'react-redux';
import { Provider } from 'react-redux';
import store from '../../store';
import { UserClientRolesType } from '../../types/UserRoleType';
import '@testing-library/jest-dom';
import { AuthProvider } from '../../contexts/AuthProvider';
Expand All @@ -31,12 +28,10 @@ const renderComponent = () => {

render(
<AuthProvider>
<QueryClientProvider client={qc}>
<Provider store={store}>
<BrowserRouter>
<BCHeaderwSide />
</BrowserRouter>
</Provider>
<QueryClientProvider client={qc}>
<BrowserRouter>
<BCHeaderwSide />
</BrowserRouter>
</QueryClientProvider>
</AuthProvider>
);
Expand Down Expand Up @@ -65,9 +60,6 @@ const state = {
},
};

vi.spyOn(redux, 'useSelector')
.mockImplementation((callback) => callback(state));

describe('BCHeaderwSide', () => {
it('should renders the component', () => {
renderComponent();
Expand All @@ -88,12 +80,6 @@ describe('BCHeaderwSide', () => {
// expect(screen.queryByText('My Profile')).not.toBeVisible();
});

// it('renders the correct number of top-level menu items', () => {
// renderComponent();
// const menuItems = screen.getAllByRole('button', { name: /.*Category.*/ });
// expect(menuItems).toHaveLength(leftMenu.length);
// });

it('renders the correct menu item names', () => {
renderComponent();
leftMenu.forEach(item => {
Expand Down
Loading

0 comments on commit e833322

Please sign in to comment.