CEC-3119 Magna access (#235)

* CEC-3119 Magna access

* Clean up

* Update test provider
This commit is contained in:
John Wu
2022-11-14 13:30:57 -08:00
committed by GitHub
parent 33bfc4fb13
commit b7e13382c4
76 changed files with 1316 additions and 918 deletions

View File

@@ -49,9 +49,7 @@ const MainForm = () => {
const onSubmit = async (e) => {
e.preventDefault();
try {
const data = {name, type};
console.log(data);
const result = await updateManifest(manifest_id, data, token);
const result = await updateManifest(manifest_id, {name, type}, token);
if (!result || result.error) return;
setMessage(`Updated manifest ${manifest_id}`);

View File

@@ -9,7 +9,7 @@ import { ManifestsProvider } from "../../Contexts/ManifestsContext";
import { UserProvider, setToken } from "../../Contexts/UserContext";
import { StatusProvider } from "../../Contexts/StatusContext";
import ManifestUpdate from ".";
import { TEST_AUTH_OBJECT } from "../../../utils/testing";
import { TEST_AUTH_OBJECT_FISKER } from "../../../utils/testing";
import addSnapshotSerializer from "../../../utils/snapshot";
const renderManifestUpdate = async () => {
@@ -33,12 +33,12 @@ const renderManifestUpdate = async () => {
describe("Manifest Details Component", () => {
beforeAll(() => {
setToken(TEST_AUTH_OBJECT);
setToken(TEST_AUTH_OBJECT_FISKER);
addSnapshotSerializer(expect);
});
it("Render", async () => {
setToken(TEST_AUTH_OBJECT);
setToken(TEST_AUTH_OBJECT_FISKER);
const view = await renderManifestUpdate();
expect(view).toMatchSnapshot();
});