Fix unit test warning

Remove unused route from test
This commit is contained in:
jwu-fisker
2021-06-09 10:56:39 -07:00
parent 067e465b59
commit c369480f24
3 changed files with 2031 additions and 2597 deletions

View File

@@ -67,10 +67,6 @@ describe("App", () => {
await check("/updates", "span.MuiButton-label", "Sign In"); await check("/updates", "span.MuiButton-label", "Sign In");
}); });
it("Route /update unauthenticated", async () => {
await check("/update/1", "span.MuiButton-label", "Sign In");
});
it("Route /carupdate-deploy unauthenticated", async () => { it("Route /carupdate-deploy unauthenticated", async () => {
await check("/carupdate-deploy/1", "span.MuiButton-label", "Sign In"); await check("/carupdate-deploy/1", "span.MuiButton-label", "Sign In");
}); });
@@ -120,11 +116,6 @@ describe("App", () => {
await check("/updates", "h6", "Deploy Packages"); await check("/updates", "h6", "Deploy Packages");
}); });
it("Route /update authenticated", async () => {
setToken(TEST_AUTH_OBJECT);
await check("/update/1", "h6", "Edit Update Package 1");
});
it("Route /carupdate-status authenticated", async () => { it("Route /carupdate-status authenticated", async () => {
setToken(TEST_AUTH_OBJECT); setToken(TEST_AUTH_OBJECT);
await check("/carupdate-status/1", "h6", "Package Package 1.0"); await check("/carupdate-status/1", "h6", "Package Package 1.0");

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,6 @@
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import { import {
Button,
Table, Table,
TableBody, TableBody,
TableCell, TableCell,
@@ -26,7 +25,6 @@ import { LocalDateTimeString } from "../../../utils/dates";
import { Roles, hasRole } from "../../../utils/roles"; import { Roles, hasRole } from "../../../utils/roles";
import TableHeaderSortable from "../../Table/HeaderSortable"; import TableHeaderSortable from "../../Table/HeaderSortable";
import SearchField from "../../Controls/SearchField"; import SearchField from "../../Controls/SearchField";
import { MicNone, PrintOutlined } from "@material-ui/icons";
const tableColumns = [ const tableColumns = [
{ {
@@ -58,7 +56,8 @@ const UpdatePackagesList = () => {
const [orderBy, setOrderBy] = useState("id"); const [orderBy, setOrderBy] = useState("id");
const [order, setOrder] = useState("desc"); const [order, setOrder] = useState("desc");
const [search, setSearch] = useState(""); const [search, setSearch] = useState("");
const { getPackages, deletePackage, packages, totalPackages } = useUpdatesContext(); const { getPackages, deletePackage, packages, totalPackages } =
useUpdatesContext();
const { const {
token: { token: {
idToken: { jwtToken: token }, idToken: { jwtToken: token },
@@ -156,15 +155,15 @@ const UpdatePackagesList = () => {
return actions.map((action) => { return actions.map((action) => {
if (action.link != null) { if (action.link != null) {
return ( return (
< Tooltip key={action.link} title={action.tip} > <Tooltip key={action.link} title={action.tip}>
<Link to={action.link} style={{ margin: 5 }}> <Link to={action.link} style={{ margin: 5 }}>
{action.icon} {action.icon}
</Link> </Link>
</Tooltip > </Tooltip>
); );
} else { } else {
return ( return (
< Tooltip key={action.link} title={action.tip} > <Tooltip key={`delete-${action.id}`} title={action.tip}>
<Typography <Typography
color="primary" color="primary"
variant="inherit" variant="inherit"
@@ -172,15 +171,8 @@ const UpdatePackagesList = () => {
> >
{action.icon} {action.icon}
</Typography> </Typography>
</Tooltip > </Tooltip>
/** );
< Tooltip key={action.link} title={action.tip} >
<Link onClick={() => onDelete(action.id)} style={{ margin: 5 }}>
{action.icon}
</Link>
</Tooltip >
*/
)
} }
}); });
}; };