[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-merchant-backoffice] branch master updated: Enhancing window mock
From: |
gnunet |
Subject: |
[taler-merchant-backoffice] branch master updated: Enhancing window mock. |
Date: |
Thu, 03 Feb 2022 22:48:09 +0100 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository merchant-backoffice.
The following commit(s) were added to refs/heads/master by this push:
new a5ca0af Enhancing window mock.
a5ca0af is described below
commit a5ca0af4bfa4585d82725ae667e2bcfc44498e2b
Author: ms <ms@taler.net>
AuthorDate: Thu Feb 3 22:46:01 2022 +0100
Enhancing window mock.
---
packages/bank/mocks/window.js | 5 ++++-
packages/bank/src/pages/home/index.tsx | 10 +++-------
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/packages/bank/mocks/window.js b/packages/bank/mocks/window.js
index dc805a6..c6185fa 100644
--- a/packages/bank/mocks/window.js
+++ b/packages/bank/mocks/window.js
@@ -1,3 +1,7 @@
+Object.defineProperty(window, 'requestAnimationFrame', {
+ value: function(cb) {} // Silence the browser.
+})
+
Object.defineProperty(window, 'localStorage', {
value: {
store: {},
@@ -12,7 +16,6 @@ Object.defineProperty(window, 'localStorage', {
}
}
});
-
Object.defineProperty(window, 'location', {
value: {
origin: "http://localhost:5000",
diff --git a/packages/bank/src/pages/home/index.tsx
b/packages/bank/src/pages/home/index.tsx
index 7ebfee8..b6feb77 100644
--- a/packages/bank/src/pages/home/index.tsx
+++ b/packages/bank/src/pages/home/index.tsx
@@ -10,10 +10,6 @@ import "../../scss/main.scss";
/**
* FIXME:
*
- * - Registering a user after a "409 Conflict" (due to a previous
- * registration attempt) doesn't render the profile page even if
- * it succedds.
- *
* - INPUT elements have their 'required' attribute ignored.
*
* - the page needs a "home" button that either redirects to
@@ -427,7 +423,7 @@ async function createTransactionCall(
}
// POST happened, status not sure yet.
if (!res.ok) {
- const responseText = await res.text();
+ const responseText = JSON.stringify(await res.json());
console.log(`Transfer creation gave response error: ${responseText}
(${res.status})`);
pageStateSetter((prevState) => ({
...prevState,
@@ -592,8 +588,8 @@ async function registrationCall(
return;
}
if (!res.ok) {
- const errorRaw = await res.text();
- console.log(`New registration gave response error (${res.status})`,
res.statusText);
+ const errorRaw = JSON.stringify(await res.json());
+ console.log(`New registration gave response error (${res.status})`,
errorRaw);
pageStateSetter((prevState) => ({
...prevState,
hasError: true,
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-merchant-backoffice] branch master updated: Enhancing window mock.,
gnunet <=