Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kark committed Jan 14, 2025
1 parent 1d15904 commit e738753
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 249 deletions.
1 change: 0 additions & 1 deletion application-templates/starter-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "16.1.0",
"@testing-library/react-hooks": "8.0.1",
"@types/jest": "^29.5.4",
"@types/react": "^19.0.3",
"@types/react-dom": "^19.0.2",
Expand Down
1 change: 0 additions & 1 deletion application-templates/starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "16.1.0",
"@testing-library/react-hooks": "8.0.1",
"@types/jest": "^29.5.4",
"@types/react": "^19.0.3",
"@types/react-dom": "^19.0.2",
Expand Down
1 change: 0 additions & 1 deletion custom-views-templates/starter-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "16.1.0",
"@testing-library/react-hooks": "8.0.1",
"@types/jest": "^29.5.4",
"@types/react": "^19.0.3",
"@types/react-dom": "^19.0.2",
Expand Down
1 change: 0 additions & 1 deletion custom-views-templates/starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "16.1.0",
"@testing-library/react-hooks": "8.0.1",
"@types/jest": "^29.5.4",
"@types/react": "^19.0.3",
"@types/react-dom": "^19.0.2",
Expand Down
1 change: 0 additions & 1 deletion packages/application-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
"@apollo/client": "3.7.14",
"@testing-library/dom": "^10.4.0",
"@testing-library/react": "16.1.0",
"@testing-library/react-hooks": "8.0.1",
"@types/jest": "^29.5.4",
"@types/raf-schd": "^4.0.1",
"@types/testing-library__jest-dom": "^5.14.9",
Expand Down
4 changes: 1 addition & 3 deletions packages/application-shell/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
"devDependencies": {
"@apollo/client": "3.7.14",
"@testing-library/react": "16.1.0",
"@testing-library/react-hooks": "8.0.1",
"@types/jest": "^29.5.4",
"@types/testing-library__jest-dom": "^5.14.9",
"jest": "29.7.0",
Expand All @@ -122,8 +121,7 @@
},
"peerDependencies": {
"@apollo/client": "3.x",
"@testing-library/react": "12.x",
"@testing-library/react-hooks": "7.x || 8.x",
"@testing-library/react": "16.x",
"react": "19.x",
"react-dom": "19.x",
"react-intl": "6.x",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const ApplicationLoader = (props: Props) => (
`}
data-testid="application-loader"
>
{/* @ts-ignore FIXME upstream */}
<LoadingSpinner />
{props.showLogo === true ? (
<img alt="commercetools logo" src={CTLogoSVG} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { GraphQLError } from 'graphql';
import { createMemoryHistory } from 'history';
import { setupServer } from 'msw/node';
import { encode } from 'qss';
import { IntlProvider } from 'react-intl';
import { useDispatch } from 'react-redux';
import { MaintenancePageLayout } from '@commercetools-frontend/application-components';
import { useApplicationContext } from '@commercetools-frontend/application-shell-connectors';
Expand Down Expand Up @@ -118,11 +117,7 @@ const renderApp = (ui, options = {}) => {
);
mocked(getBrowserHistory).mockReturnValue(testHistory);

const { container } = render(
<IntlProvider locale="en" messages={{}}>
<ApplicationShell {...props} />
</IntlProvider>
);
const { container } = render(<ApplicationShell {...props} />);
const findByLeftNavigation = () => screen.findByTestId('left-navigation');
const queryByLeftNavigation = () => screen.queryByTestId('left-navigation');
const getByLeftNavigation = () => screen.getByTestId('left-navigation');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,6 @@ const Butler = (props: Props) => {
margin-right: ${uiKitDesignTokens.spacingS};
`}
>
{/* @ts-ignore FIXME upstream */}
<LoadingSpinner />
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const RequestsInFlightLoader = () => {
if (!hasRequestsInFlight) return null;

return ReactDOM.createPortal(
// @ts-ignore FIXME upstream
<LoadingSpinner>
<FormattedMessage {...messages.labelLoading} />
</LoadingSpinner>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import LoadingSpinner from '@commercetools-uikit/loading-spinner';

const SuspendedRoute = (props: RouteProps) => (
<Route {...props}>
{/* @ts-ignore FIXME upstream */}
<Suspense fallback={<LoadingSpinner />}>
{props.children as ReactNode}
</Suspense>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ const useRoutes = () => {
return routes;
};

type TRoutes = ReturnType<typeof useRoutes>;

describe('creating routes', () => {
describe('getUrl', () => {
it('should compute URL path', () => {
const { result } = hooks.renderHook(() => useRoutes());
const routes = result.current as ReturnType<typeof useRoutes>;
const routes = result.current as TRoutes;

expect(routes).toEqual(
expect.objectContaining({
Expand Down Expand Up @@ -51,15 +53,15 @@ describe('creating routes', () => {
});
it('throws when required params are missing', () => {
const { result } = hooks.renderHook(() => useRoutes());
const routes = result.current as ReturnType<typeof useRoutes>;
const routes = result.current as TRoutes;

expect(() => routes.heroDetail.getUrl()).toThrow();
});
});
describe('go', () => {
it('should redirect to another route', () => {
const { result, history } = hooks.renderHook(() => useRoutes());
const routes = result.current as ReturnType<typeof useRoutes>;
const routes = result.current as TRoutes;

expect(history.location.pathname).toMatchInlineSnapshot(
`"/test-with-big-data/random-entry-point"`
Expand All @@ -81,7 +83,7 @@ describe('creating routes', () => {
});
it('throws when required params are missing', () => {
const { result } = hooks.renderHook(() => useRoutes());
const routes = result.current as ReturnType<typeof useRoutes>;
const routes = result.current as TRoutes;

expect(() => routes.heroDetail.go()).toThrow();
});
Expand Down
Loading

0 comments on commit e738753

Please sign in to comment.