update inventory and host routes to being child-based instead of render prop based

This commit is contained in:
John Mitchell
2020-04-06 15:05:11 -04:00
parent 2021c2a596
commit ce30594b30
7 changed files with 21 additions and 32 deletions

View File

@@ -90,10 +90,9 @@ describe('<HostGroupsList />', () => {
}); });
await act(async () => { await act(async () => {
wrapper = mountWithContexts( wrapper = mountWithContexts(
<Route <Route path="/hosts/:id/groups">
path="/hosts/:id/groups" <HostGroupsList host={host} />
component={() => <HostGroupsList host={host} />} </Route>,
/>,
{ {
context: { context: {
router: { history, route: { location: history.location } }, router: { history, route: { location: history.location } },

View File

@@ -43,12 +43,9 @@ describe('<InventoryGroup />', () => {
}); });
await act(async () => { await act(async () => {
wrapper = mountWithContexts( wrapper = mountWithContexts(
<Route <Route path="/inventories/inventory/:id/groups">
path="/inventories/inventory/:id/groups" <InventoryGroup setBreadcrumb={() => {}} inventory={inventory} />
component={() => ( </Route>,
<InventoryGroup setBreadcrumb={() => {}} inventory={inventory} />
)}
/>,
{ context: { router: { history } } } { context: { router: { history } } }
); );
}); });

View File

@@ -19,10 +19,9 @@ describe('<InventoryGroupAdd />', () => {
}); });
await act(async () => { await act(async () => {
wrapper = mountWithContexts( wrapper = mountWithContexts(
<Route <Route path="/inventories/inventory/:id/groups/add">
path="/inventories/inventory/:id/groups/add" <InventoryGroupAdd />
component={() => <InventoryGroupAdd />} </Route>,
/>,
{ {
context: { context: {
router: { history, route: { location: history.location } }, router: { history, route: { location: history.location } },

View File

@@ -36,12 +36,9 @@ describe('<InventoryGroupDetail />', () => {
initialEntries: ['/inventories/inventory/1/groups/1/details'], initialEntries: ['/inventories/inventory/1/groups/1/details'],
}); });
wrapper = mountWithContexts( wrapper = mountWithContexts(
<Route <Route path="/inventories/inventory/:id/groups/:groupId">
path="/inventories/inventory/:id/groups/:groupId" <InventoryGroupDetail inventoryGroup={inventoryGroup} />
component={() => ( </Route>,
<InventoryGroupDetail inventoryGroup={inventoryGroup} />
)}
/>,
{ {
context: { context: {
router: { router: {

View File

@@ -24,10 +24,9 @@ describe('<InventoryGroupEdit />', () => {
}); });
await act(async () => { await act(async () => {
wrapper = mountWithContexts( wrapper = mountWithContexts(
<Route <Route path="/inventories/inventory/:id/groups/:groupId/edit">
path="/inventories/inventory/:id/groups/:groupId/edit" <InventoryGroupEdit inventoryGroup={{ id: 2 }} />
component={() => <InventoryGroupEdit inventoryGroup={{ id: 2 }} />} </Route>,
/>,
{ {
context: { context: {
router: { router: {

View File

@@ -73,10 +73,9 @@ describe('<InventoryGroupsList />', () => {
}); });
await act(async () => { await act(async () => {
wrapper = mountWithContexts( wrapper = mountWithContexts(
<Route <Route path="/inventories/inventory/:id/groups">
path="/inventories/inventory/:id/groups" <InventoryGroupsList />
component={() => <InventoryGroupsList />} </Route>,
/>,
{ {
context: { context: {
router: { history, route: { location: history.location } }, router: { history, route: { location: history.location } },

View File

@@ -82,10 +82,9 @@ describe('<InventoryHostGroupsList />', () => {
}); });
await act(async () => { await act(async () => {
wrapper = mountWithContexts( wrapper = mountWithContexts(
<Route <Route path="/inventories/inventory/:id/hosts/:hostId/groups">
path="/inventories/inventory/:id/hosts/:hostId/groups" <InventoryHostGroupsList />
component={() => <InventoryHostGroupsList />} </Route>,
/>,
{ {
context: { context: {
router: { history, route: { location: history.location } }, router: { history, route: { location: history.location } },