Skip to content

Commit

Permalink
erge branch 'nested-routes-for-manufacturers-#1154' into nested-route…
Browse files Browse the repository at this point in the history
…s-for-admin-page-#1211
  • Loading branch information
joshuadkitenge committed Jan 6, 2025
2 parents a125348 + 6f07114 commit 650ceea
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
7 changes: 3 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import { HomePage } from './homePage/homePage.component';
import IMSThemeProvider from './imsThemeProvider.component';
import Items from './items/items.component';
import ItemsLandingPage from './items/itemsLandingPage.component';
import ManufacturerContainer from './manufacturer/manufacturerContainer.component';
import ManufacturerLandingPage from './manufacturer/manufacturerLandingPage.component';
import ManufacturerLayout from './manufacturer/manufacturerLayout.component';
import ManufacturerTable from './manufacturer/manufacturersTable.component';
import Preloader from './preloader/preloader.component';
import retryIMS_APIErrors from './retryIMS_APIErrors';
Expand Down Expand Up @@ -80,7 +80,6 @@ const router = createBrowserRouter([
{
Component: Layout,
children: [
{ path: paths.any, Component: ViewTabs },
{ path: paths.root, Component: HomePage },
{ path: paths.homepage, Component: HomePage },
{
Expand Down Expand Up @@ -114,9 +113,9 @@ const router = createBrowserRouter([
{ path: paths.systems, Component: Systems },
{
path: paths.manufacturers,
Component: ManufacturerContainer,
Component: ManufacturerLayout,
children: [
{ path: '', Component: ManufacturerTable },
{ index: true, Component: ManufacturerTable },
{ path: paths.manufacturer, Component: ManufacturerLandingPage },
{
path: '*',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { screen, waitFor } from '@testing-library/react';
import userEvent, { UserEvent } from '@testing-library/user-event';
import { renderComponentWithRouterProvider } from '../testUtils';
import ManufacturerContainer from './manufacturerContainer.component';
import ManufacturerLayout from './manufacturerLayout.component';

const mockedUseNavigate = vi.fn();

Expand All @@ -10,11 +10,11 @@ vi.mock('react-router-dom', async () => ({
useNavigate: () => mockedUseNavigate,
}));

describe('Manufacturer Container', () => {
describe('Manufacturer Layout', () => {
let user: UserEvent;
const createView = (path: string, isLandingPage?: boolean) => {
return renderComponentWithRouterProvider(
<ManufacturerContainer />,
<ManufacturerLayout />,
isLandingPage ? 'manufacturer' : 'manufacturers',
path
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useGetManufacturer } from '../api/manufacturers';
import { paths } from '../App';
import Breadcrumbs from '../view/breadcrumbs.component';

function ManufacturerContainer() {
function ManufacturerLayout() {
const { manufacturer_id: manufacturerId } = useParams();

const { data: manufacturerData } = useGetManufacturer(manufacturerId);
Expand Down Expand Up @@ -60,4 +60,4 @@ function ManufacturerContainer() {
</div>
);
}
export default ManufacturerContainer;
export default ManufacturerLayout;

0 comments on commit 650ceea

Please sign in to comment.