Skip to content

Commit

Permalink
Merge pull request #6081 from transcom/sr-fix-prod-root
Browse files Browse the repository at this point in the history
Move root route back up above getWorkflowRoutes
  • Loading branch information
Suzanne Rozier authored Mar 9, 2021
2 parents f11642b + 5cc7489 commit 560b0aa
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/scenes/MyMove/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ export class CustomerApp extends Component {

{/* auth required */}
<CustomerPrivateRoute exact path="/ppm" component={PpmLanding} />

{/* ROOT */}
<CustomerPrivateRoute path="/" exact component={Home} />

{getWorkflowRoutes(props)}
<CustomerPrivateRoute exact path="/moves/:moveId/edit" component={Edit} />
<CustomerPrivateRoute exact path="/moves/review/edit-profile" component={EditProfile} />
Expand Down Expand Up @@ -179,9 +183,6 @@ export class CustomerApp extends Component {
</div>
</Route>

{/* ROOT */}
<CustomerPrivateRoute path="/" exact component={Home} />

{/* 404 */}
<Route component={this.noMatch} />
</Switch>
Expand Down
54 changes: 52 additions & 2 deletions src/scenes/MyMove/index.test.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,61 @@
import React from 'react';
import { shallow } from 'enzyme';
import { shallow, mount } from 'enzyme';

import { CustomerApp } from './index';
import ConnectedCustomerApp, { CustomerApp } from './index';

import Header from 'shared/Header/MyMove';
import Footer from 'shared/Footer';
import SomethingWentWrong from 'shared/SomethingWentWrong';
import { MockProviders } from 'testUtils';
import { AppContext } from 'shared/AppContext';

describe('ConnectedCustomerApp tests', () => {
describe('with GHC/HHG feature flags turned off', () => {
const mockContext = {
flags: {
hhgFlow: false,
ghcFlow: false,
},
};

it('renders without crashing or erroring', () => {
const wrapper = mount(
<MockProviders initialEntries={['/']}>
<AppContext.Provider value={mockContext}>
<ConnectedCustomerApp />
</AppContext.Provider>
</MockProviders>,
);
const appWrapper = wrapper.find('#app-root');
expect(appWrapper).toBeDefined();
expect(appWrapper.find('PageNotInFlow')).toHaveLength(0);
expect(wrapper.find(SomethingWentWrong)).toHaveLength(0);
});
});

describe('with GHC/HHG feature flags turned on', () => {
const mockContext = {
flags: {
hhgFlow: true,
ghcFlow: true,
},
};

it('renders without crashing or erroring', () => {
const wrapper = mount(
<MockProviders initialEntries={['/']}>
<AppContext.Provider value={mockContext}>
<ConnectedCustomerApp />
</AppContext.Provider>
</MockProviders>,
);
const appWrapper = wrapper.find('#app-root');
expect(appWrapper).toBeDefined();
expect(appWrapper.find('PageNotInFlow')).toHaveLength(0);
expect(wrapper.find(SomethingWentWrong)).toHaveLength(0);
});
});
});

describe('CustomerApp tests', () => {
let wrapper;
Expand Down

0 comments on commit 560b0aa

Please sign in to comment.