Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div className="App">
Expand Down