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 () => {
wrapper = mountWithContexts(
<Route
path="/hosts/:id/groups"
component={() => <HostGroupsList host={host} />}
/>,
<Route path="/hosts/:id/groups">
<HostGroupsList host={host} />
</Route>,
{
context: {
router: { history, route: { location: history.location } },

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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