Skip to content

Commit

Permalink
Merge pull request #1587 from hackforla/revert-1584-new-routing-tests…
Browse files Browse the repository at this point in the history
…-1249

Revert "routing tests on new branch for #1249"
  • Loading branch information
sydneywalcoff authored Sep 30, 2024
2 parents 2fcf8c2 + 79db173 commit aba6437
Show file tree
Hide file tree
Showing 13 changed files with 23,452 additions and 10,826 deletions.
4 changes: 0 additions & 4 deletions products/statement-generator/jest.config

This file was deleted.

34,034 changes: 23,427 additions & 10,607 deletions products/statement-generator/package-lock.json

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions products/statement-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"dependencies": {
"@material-ui/core": "^4.11.2",
"@material-ui/icons": "^4.11.2",
"canvas": "^2.11.2",
"docx": "^8.0.4",
"file-saver": "^2.0.5",
"gh-pages": "^5.0.0",
Expand Down Expand Up @@ -65,7 +64,6 @@
"@types/react-router-dom": "^5.3.3",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.9.0",
"@babel/plugin-proposal-private-property-in-object": "^7.18.6",
"eslint": "^7.15.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^9.1.0",
Expand Down
14 changes: 1 addition & 13 deletions products/statement-generator/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import React from 'react';
import {
BrowserRouter as Router,
Route,
Switch,
useLocation,
} from 'react-router-dom';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import { ThemeProvider } from '@material-ui/core/styles';

import { RoutingContextProvider } from 'contexts/RoutingContext';
Expand Down Expand Up @@ -51,12 +46,6 @@ import customMuiTheme from 'styles/customMuiTheme';
import { useTranslation } from 'react-i18next';
import ScrollToTop from './components-layout/ScrollToTop';

export const LocationDisplay = () => {
const location = useLocation();

return <div data-testid="location-display">{location.pathname}</div>;
};

const App: React.FC = () => {
const { i18n } = useTranslation();

Expand Down Expand Up @@ -198,7 +187,6 @@ const App: React.FC = () => {
</Switch>
<AppFooter />
</PageContainer>
<LocationDisplay />
</FormStateContextProvider>
</AffirmationContextProvider>
</RoutingContextProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ const Affirmation = () => {
const { updateStepToForm } = useContext(FormStateContext);
const history = useHistory();
const { t } = useTranslation();
const { affirmationData, updateAffirmationData } =
useContext(AffirmationContext);
const { affirmationData, updateAffirmationData } = useContext(
AffirmationContext
);
const returnHome = () => {
const path = AppUrl.Landing;
updateAffirmationData({ isActive: false });
Expand Down
9 changes: 1 addition & 8 deletions products/statement-generator/src/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,25 +186,18 @@ interface ILinkButtonComponent {
theme?: string;
buttonText: string;
to: string;
dataTestid?: string;
}

export function LinkButtonComponent({
className = '',
theme,
buttonText,
to,
dataTestid,
}: ILinkButtonComponent) {
const styleProps = { theme };
const classes = useStyles(styleProps);
return (
<Link
type="button"
className={`${classes.root} ${className}`}
to={to!}
data-testid={dataTestid}
>
<Link type="button" className={`${classes.root} ${className}`} to={to!}>
{buttonText}
</Link>
);
Expand Down
12 changes: 8 additions & 4 deletions products/statement-generator/src/components/TextPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,14 @@ interface ComponentProps {
}

const TextPreview = forwardRef<HTMLDivElement, ComponentProps>(
(
{ onSaveClick, content, nameOfStep, className = '', style, isFirstPreview },
ref
) => {
({
onSaveClick,
content,
nameOfStep,
className = '',
style,
isFirstPreview,
}) => {
const classes = useStyles();
const utilityClasses = useUtilityStyles();
const [isEditing, setIsEditing] = useState<boolean>(false);
Expand Down
2 changes: 1 addition & 1 deletion products/statement-generator/src/components/Textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const MultilineTextFields = React.forwardRef<HTMLDivElement, TextFieldProps>(
defaultValue={defaultValue}
disabled={disabled}
value={value}
minRows={rows}
rows={rows}
multiline
fullWidth
variant="outlined"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ import Input from '../components/Input';
function InvolvementCommunityServiceFlow() {
const { t } = useTranslation();
const { formState, updateStepToForm } = useContext(FormStateContext);
const { organizationName, serviceDescription } =
formState.communityServiceState;
const {
organizationName,
serviceDescription,
} = formState.communityServiceState;

const organizationNameValid = organizationName !== '';
const serviceDescriptionValid = serviceDescription !== '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ import {
function InvolvementJobFlow() {
const { t } = useTranslation();
const { formState, updateStepToForm } = useContext(FormStateContext);
const { companyName, jobTitle, jobDescription } =
formState.involvementJobState;
const {
companyName,
jobTitle,
jobDescription,
} = formState.involvementJobState;

const companyNameValid = companyName !== '';
const jobTitleValid = jobTitle !== '';
Expand Down
1 change: 0 additions & 1 deletion products/statement-generator/src/pages/Landing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ function LandingSection1() {
<LinkButtonComponent
to={AppUrl.Welcome}
buttonText={t('button.startNow')}
dataTestid="start-now-button"
/>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions products/statement-generator/src/styles/customMuiTheme.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { createTheme } from '@material-ui/core';
import { createMuiTheme } from '@material-ui/core';

/**
* @link https://v4.mui.com/customization/theming/
*/
const customMuiTheme = createTheme({
const customMuiTheme = createMuiTheme({
globals: {
contentWidth: 600,
wideWidth: 960,
Expand Down
178 changes: 0 additions & 178 deletions products/statement-generator/src/tests/routing.tests.tsx

This file was deleted.

0 comments on commit aba6437

Please sign in to comment.