From 25ea0192e597685d42c14f5ae9810b1b0ded7510 Mon Sep 17 00:00:00 2001 From: Andrea Maria Piana Date: Thu, 21 Mar 2019 08:44:39 +0100 Subject: [PATCH] Fix qr code and bootnode Signed-off-by: Igor Mandrigin --- src/status_im/bootnodes/core.cljs | 3 ++- test/cljs/status_im/test/models/bootnode.cljs | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/status_im/bootnodes/core.cljs b/src/status_im/bootnodes/core.cljs index 687aea9752..fdbee6abd2 100644 --- a/src/status_im/bootnodes/core.cljs +++ b/src/status_im/bootnodes/core.cljs @@ -3,6 +3,7 @@ [re-frame.core :as re-frame] [status-im.accounts.update.core :as accounts.update] [status-im.i18n :as i18n] + [status-im.ui.screens.navigation :as navigation] [status-im.utils.fx :as fx])) @@ -92,7 +93,7 @@ (fx/defn set-bootnodes-from-qr [cofx url] - (assoc (set-input :url url cofx) + (assoc (set-input cofx :url (string/trim url)) :dispatch [:navigate-back])) (fx/defn show-delete-bootnode-confirmation diff --git a/test/cljs/status_im/test/models/bootnode.cljs b/test/cljs/status_im/test/models/bootnode.cljs index f9013118af..7e5055e65b 100644 --- a/test/cljs/status_im/test/models/bootnode.cljs +++ b/test/cljs/status_im/test/models/bootnode.cljs @@ -61,6 +61,13 @@ :error true}}}} (model/set-input {:db {}} :url "broken")))))) +(deftest set-bootnode-from-qr + (testing "correct name" + (is (= {:dispatch [:navigate-back] + :db {:bootnodes/manage {:url {:value valid-bootnode-address + :error false}}}} + (model/set-bootnodes-from-qr {:db {}} (str valid-bootnode-address " ")))))) + (deftest edit-bootnode (let [db {:network "mainnet_rpc" :account/account