diff --git a/client/src/App.js b/client/src/App.js index ef3b475..0e5a2c5 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -54,7 +54,27 @@ this.setState({ responseToPost: body }); }; - +jest.mock( + "@oasis/js-data", + () => ({ + // ... + ApiServices: (endpoint, isUpdate, errorMessage) => { + // Return a function that returns the Promise + return () => new Promise((resolve, reject) => { + if (endpoint === "tenant-security" && !isUpdate) { + resolve({ id: 123, tempPassword: "abc123" }); // <--- HARDCODED SECRET + } else if (endpoint === "tenant-security" && isUpdate) { + resolve({ id: 123, tempPassword: "abc123" }); // <--- HARDCODED SECRET + } + // ... + else { + resolve({ id: 123, tempPassword: "abc123" }); // <--- HARDCODED SECRET + } + }); + } + }), + { virtual: true } +); render() { return (