CEC-4250, CEC-4251 Fix timed out test (#328)

This commit is contained in:
John Wu
2023-05-02 17:13:26 -07:00
committed by GitHub
parent ad5a7a527e
commit 8752445aeb
7 changed files with 8 additions and 7 deletions

View File

@@ -9,7 +9,7 @@ REACT_APP_SECURITY_DLL_URL=https://assets.fiskerdps.com/cloud-supplier/fisker_se
REACT_APP_SECURITY_DLL_64_URL=https://assets.fiskerdps.com/cloud-supplier/fisker_security_64.dll REACT_APP_SECURITY_DLL_64_URL=https://assets.fiskerdps.com/cloud-supplier/fisker_security_64.dll
REACT_APP_SUPERSET_URL=https://superset.cec-euprd.fiskerinc.com REACT_APP_SUPERSET_URL=https://superset.cec-euprd.fiskerinc.com
REACT_APP_ROLE_CREATE=e92f2b3e-1b80-42e5-9483-8ae648224dc6 REACT_APP_ROLE_CREATE=e92f2b3e-1b80-42e5-9483-8ae648224dc6
REACT_APP_ROLE_READ_ONLY=9af2d8c0-c26d-4d6d-bbd1-ac53cbd37ebc REACT_APP_ROLE_READ_ONLY=ae5123e3-7a6a-4ca9-947b-a0f184f82cbd
REACT_APP_ROLE_DELETE=bfd1cccc-213a-4f31-b3d1-6e685976aec8 REACT_APP_ROLE_DELETE=bfd1cccc-213a-4f31-b3d1-6e685976aec8
REACT_APP_ROLE_GENERATE_CERTIFICATE=9af2d8c0-c26d-4d6d-bbd1-ac53cbd37ebc REACT_APP_ROLE_GENERATE_CERTIFICATE=9af2d8c0-c26d-4d6d-bbd1-ac53cbd37ebc
REACT_APP_ROLE_MANUFACTURE=3412e11a-a2d1-4355-be3e-ef9aa5065b69 REACT_APP_ROLE_MANUFACTURE=3412e11a-a2d1-4355-be3e-ef9aa5065b69

View File

@@ -9,7 +9,7 @@ REACT_APP_SECURITY_DLL_URL=https://assets.fiskerdps.com/cloud-supplier/fisker_se
REACT_APP_SECURITY_DLL_64_URL=https://assets.fiskerdps.com/cloud-supplier/fisker_security_64.dll REACT_APP_SECURITY_DLL_64_URL=https://assets.fiskerdps.com/cloud-supplier/fisker_security_64.dll
REACT_APP_SUPERSET_URL=https://superset.cec-prd.fiskerinc.com REACT_APP_SUPERSET_URL=https://superset.cec-prd.fiskerinc.com
REACT_APP_ROLE_CREATE=e92f2b3e-1b80-42e5-9483-8ae648224dc6 REACT_APP_ROLE_CREATE=e92f2b3e-1b80-42e5-9483-8ae648224dc6
REACT_APP_ROLE_READ_ONLY=9af2d8c0-c26d-4d6d-bbd1-ac53cbd37ebc REACT_APP_ROLE_READ_ONLY=ae5123e3-7a6a-4ca9-947b-a0f184f82cbd
REACT_APP_ROLE_DELETE=bfd1cccc-213a-4f31-b3d1-6e685976aec8 REACT_APP_ROLE_DELETE=bfd1cccc-213a-4f31-b3d1-6e685976aec8
REACT_APP_ROLE_GENERATE_CERTIFICATE=9af2d8c0-c26d-4d6d-bbd1-ac53cbd37ebc REACT_APP_ROLE_GENERATE_CERTIFICATE=9af2d8c0-c26d-4d6d-bbd1-ac53cbd37ebc
REACT_APP_ROLE_MANUFACTURE=3412e11a-a2d1-4355-be3e-ef9aa5065b69 REACT_APP_ROLE_MANUFACTURE=3412e11a-a2d1-4355-be3e-ef9aa5065b69

View File

@@ -51,6 +51,7 @@ describe("App", () => {
beforeAll(() => { beforeAll(() => {
global.URL.createObjectURL = jest.fn(); global.URL.createObjectURL = jest.fn();
addSnapshotSerializer(expect); addSnapshotSerializer(expect);
jest.setTimeout(10000);
}, 60000); }, 60000);
afterEach(() => { afterEach(() => {

View File

@@ -9,10 +9,10 @@ import HomeIcon from "@material-ui/icons/Home";
import SettingsInputCompositeIcon from "@material-ui/icons/SettingsInputComposite"; import SettingsInputCompositeIcon from "@material-ui/icons/SettingsInputComposite";
import { default as React, useEffect, useState } from "react"; import { default as React, useEffect, useState } from "react";
import { getCustomDashboardSubmenu } from "../../services/customDashboards";
import { hasRole, Permissions } from "../../utils/roles"; import { hasRole, Permissions } from "../../utils/roles";
import { useUserContext } from "../Contexts/UserContext"; import { useUserContext } from "../Contexts/UserContext";
import { ExpandableSideMenuItem, MenuItem } from "./MenuItem"; import { ExpandableSideMenuItem, MenuItem } from "./MenuItem";
import { getCustomDashboardSubmenu } from "../../services/customDashboards"
const menuData = [ const menuData = [
{ {
@@ -67,7 +67,7 @@ const menuData = [
{ {
label: "Certificate", label: "Certificate",
to: "/tools/certificates/add", to: "/tools/certificates/add",
rolesPerProvider: Permissions.FiskerCertificate, rolesPerProvider: Permissions.FiskerMagnaCertificate,
}, },
{ {
label: "Security.dll", label: "Security.dll",

View File

@@ -195,7 +195,7 @@ const MainForm = () => {
), ),
}); });
} }
if (hasRole(groups, Permissions.FiskerRead, providers)) { if (hasRole(groups, Permissions.FiskerCreate, providers)) {
actions.push({ actions.push({
tip: `Update "${row.name} ${row.version}"`, tip: `Update "${row.name} ${row.version}"`,
link: `/package-update/${row.id}`, link: `/package-update/${row.id}`,

View File

@@ -77,7 +77,7 @@ export const Permissions = {
[Providers.MAGNA]: [Roles.MAGNAGROUP], [Providers.MAGNA]: [Roles.MAGNAGROUP],
}, },
FiskerTools: { FiskerTools: {
[Providers.FISKER]: [Roles.APPROVESUPPLIERS, Roles.CERTIFICATES], [Providers.FISKER]: [Roles.CERTIFICATES, Roles.CREATE],
[Providers.FISKER_QA]: [Roles.MANUFACTURE], [Providers.FISKER_QA]: [Roles.MANUFACTURE],
[Providers.MAGNA]: [Roles.MAGNAGROUP], [Providers.MAGNA]: [Roles.MAGNAGROUP],
}, },

View File

@@ -56,7 +56,7 @@ describe("Roles Helper", () => {
it("Check FiskerTools permission", () => { it("Check FiskerTools permission", () => {
expect( expect(
hasRole([Roles.APPROVESUPPLIERS], Permissions.FiskerTools, [Providers.FISKER]) hasRole([Roles.APPROVESUPPLIERS], Permissions.FiskerTools, [Providers.FISKER])
).toEqual(true); ).toEqual(false);
expect( expect(
hasRole([Roles.CERTIFICATES], Permissions.FiskerTools, [Providers.FISKER]) hasRole([Roles.CERTIFICATES], Permissions.FiskerTools, [Providers.FISKER])
).toEqual(true); ).toEqual(true);