From f12c6dfa4090ebc9026354cd3a872de72f084e91 Mon Sep 17 00:00:00 2001 From: Stefan Date: Fri, 15 Mar 2024 18:01:53 +0200 Subject: [PATCH] chore(storybook): fix TransactionDetailViewPage to test links --- storybook/pages/TransactionDetailViewPage.qml | 12 ++++++++-- .../sectionmocks/WalletSectionAccounts.qml | 22 +++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 storybook/stubs/nim/sectionmocks/WalletSectionAccounts.qml diff --git a/storybook/pages/TransactionDetailViewPage.qml b/storybook/pages/TransactionDetailViewPage.qml index b5aa0418d8..c5910e256d 100644 --- a/storybook/pages/TransactionDetailViewPage.qml +++ b/storybook/pages/TransactionDetailViewPage.qml @@ -140,13 +140,14 @@ SplitView { property int timestamp: Date.now() / 1000 property int txStatus: 0 property string type: "eth" - property string from: "0x29D7d1dd5B6f9C864d9db560D72a247c178aE86B" - property string to: "0x4de3f6278C0DdFd3F29df9DcD979038F5c7bbc35" + property string from: "eth:arb:opt:0xb38e8c17e38363af6ebdcb3dae12e0243582891d" + property string to: "0xBE0eB53F46cd790Cd13851d5EFf43D12404d33E8" property bool isNFT: false property string tokenID: "4981676894159712808201908443964193325271219637660871887967796332739046670337" property string nftName: "Happy Meow" property string nftImageUrl: Style.png("collectibles/HappyMeow") property string symbol: "ETH" + property int txType: Constants.TransactionType.Send readonly property var value: QtObject { property real amount: amountSpinbox.realValue @@ -181,6 +182,12 @@ SplitView { property var mixedcaseAddress: root.isIncoming ? transactionData.to : transactionData.from } + QtObject { + id: networkConnectionStoreMockup + + property bool sendBuyBridgeEnabled: true + } + QtObject { id: controllerMockup @@ -226,6 +233,7 @@ SplitView { contactsStore: contactsStoreMockup controller: controllerMockup overview: overviewMockup + networkConnectionStore: networkConnectionStoreMockup } } } diff --git a/storybook/stubs/nim/sectionmocks/WalletSectionAccounts.qml b/storybook/stubs/nim/sectionmocks/WalletSectionAccounts.qml new file mode 100644 index 0000000000..f153521422 --- /dev/null +++ b/storybook/stubs/nim/sectionmocks/WalletSectionAccounts.qml @@ -0,0 +1,22 @@ +import QtQuick 2.15 + +// Required mock of: src/app/modules/main/wallet_section/accounts/view.nim + +Item { + readonly property string contextPropertyName: "walletSectionAccounts" + + // Required + // + function getNameByAddress(address) { + return "Name Mock " + address.substring(0, 5) + } + + // + // Silence warnings + readonly property QtObject overview: QtObject { + readonly property string mixedcaseAddress: "" + } + readonly property ListModel mixedcaseAddress: ListModel {} + + signal walletAccountRemoved(string address) +} \ No newline at end of file