Skip to content

Commit

Permalink
Renamed systemsContainer to systemsLayout for better clarity #1213
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuadkitenge committed Jan 6, 2025
1 parent 07fa53e commit 5339254
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import {
tokenRefreshed,
} from './state/scigateway.actions';
import Systems from './systems/systems.component';
import SystemsContainer from './systems/systemsContainer.component';
import SystemsLayout from './systems/systemsLayout.component';
import ViewTabs from './view/viewTabs.component';

export const paths = {
Expand Down Expand Up @@ -114,7 +114,7 @@ const router = createBrowserRouter([
},
{
path: paths.systems,
Component: SystemsContainer,
Component: SystemsLayout,
children: [
{ index: true, Component: Systems },
{ path: paths.system, Component: Systems },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Systems Container > renders root systems correctly 1`] = `
exports[`Systems Layout > renders root systems correctly 1`] = `
<DocumentFragment>
<div
class="MuiBox-root css-10klw3m"
Expand Down Expand Up @@ -56,7 +56,7 @@ exports[`Systems Container > renders root systems correctly 1`] = `
</DocumentFragment>
`;

exports[`Systems Container > renders units breadcrumbs correctly 1`] = `
exports[`Systems Layout > renders units breadcrumbs correctly 1`] = `
<DocumentFragment>
<div
class="MuiBox-root css-10klw3m"
Expand Down
2 changes: 1 addition & 1 deletion src/systems/systems.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import { DeleteSystemDialog } from './deleteSystemDialog.component';
import SystemDetails from './systemDetails.component';
import SystemDialog from './systemDialog.component';
import { SystemDirectoryDialog } from './systemDirectoryDialog.component';
import { useNavigateToSystem } from './systemsContainer.component';
import { useNavigateToSystem } from './systemsLayout.component';

export type SystemMenuDialogType = 'edit' | 'duplicate' | 'delete';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { screen, waitFor } from '@testing-library/react';
import userEvent, { UserEvent } from '@testing-library/user-event';
import { paths } from '../App';
import { renderComponentWithRouterProvider } from '../testUtils';
import SystemsContainer from './systemsContainer.component';
import SystemsLayout from './systemsLayout.component';

const mockedUseNavigate = vi.fn();

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

describe('Systems Container', () => {
describe('Systems Layout', () => {
let user: UserEvent;

beforeEach(() => {
user = userEvent.setup();
});
const createView = (path: string, urlPathKey: keyof typeof paths) => {
return renderComponentWithRouterProvider(
<SystemsContainer />,
<SystemsLayout />,
urlPathKey,
path
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const useNavigateToSystem = () => {
);
};

function SystemsContainer() {
function SystemsLayout() {
const { system_id: systemId } = useParams();
const navigateToSystem = useNavigateToSystem();

Expand Down Expand Up @@ -57,4 +57,4 @@ function SystemsContainer() {
);
}

export default SystemsContainer;
export default SystemsLayout;

0 comments on commit 5339254

Please sign in to comment.