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");
});
it("Route /update unauthenticated", async () => {
await check("/update/1", "span.MuiButton-label", "Sign In");
});
it("Route /carupdate-deploy unauthenticated", async () => {
await check("/carupdate-deploy/1", "span.MuiButton-label", "Sign In");
});
@@ -120,11 +116,6 @@ describe("App", () => {
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 () => {
setToken(TEST_AUTH_OBJECT);
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 { Link } from "react-router-dom";
import {
Button,
Table,
TableBody,
TableCell,
@@ -26,7 +25,6 @@ import { LocalDateTimeString } from "../../../utils/dates";
import { Roles, hasRole } from "../../../utils/roles";
import TableHeaderSortable from "../../Table/HeaderSortable";
import SearchField from "../../Controls/SearchField";
import { MicNone, PrintOutlined } from "@material-ui/icons";
const tableColumns = [
{
@@ -58,7 +56,8 @@ const UpdatePackagesList = () => {
const [orderBy, setOrderBy] = useState("id");
const [order, setOrder] = useState("desc");
const [search, setSearch] = useState("");
const { getPackages, deletePackage, packages, totalPackages } = useUpdatesContext();
const { getPackages, deletePackage, packages, totalPackages } =
useUpdatesContext();
const {
token: {
idToken: { jwtToken: token },
@@ -156,15 +155,15 @@ const UpdatePackagesList = () => {
return actions.map((action) => {
if (action.link != null) {
return (
< Tooltip key={action.link} title={action.tip} >
<Tooltip key={action.link} title={action.tip}>
<Link to={action.link} style={{ margin: 5 }}>
{action.icon}
</Link>
</Tooltip >
</Tooltip>
);
} else {
return (
< Tooltip key={action.link} title={action.tip} >
<Tooltip key={`delete-${action.id}`} title={action.tip}>
<Typography
color="primary"
variant="inherit"
@@ -172,15 +171,8 @@ const UpdatePackagesList = () => {
>
{action.icon}
</Typography>
</Tooltip >
/**
< Tooltip key={action.link} title={action.tip} >
<Link onClick={() => onDelete(action.id)} style={{ margin: 5 }}>
{action.icon}
</Link>
</Tooltip >
*/
)
</Tooltip>
);
}
});
};