Skip to content

Commit 0713305

Browse files
Khushboo mehtaKhushboo mehta
Khushboo mehta
authored and
Khushboo mehta
committed
fix(@desktop/wallet): Fix Qml Tests on qt6.9.0 for
1. BuyReceiveBanner 2. DappsComboBox 3. SendRecipientInput 4. SimpleSendRecipientInput 5.SwapInputPanel fixes #17705, #17707
1 parent 99b31d1 commit 0713305

File tree

9 files changed

+31
-14
lines changed

9 files changed

+31
-14
lines changed

storybook/pages/SwapInputPanelPage.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ SplitView {
106106
}
107107

108108
currencyStore: d.adaptor.currencyStore
109-
flatNetworksModel: d.adaptor.swapStore.flatNetworks
109+
flatNetworksModel: d.adaptor.networksStore.activeNetworks
110110
processedAssetsModel: d.adaptor.walletAssetsStore.groupedAccountAssetsModel
111111
plainTokensBySymbolModel: plainTokensModel
112112

@@ -133,7 +133,7 @@ SplitView {
133133
}
134134

135135
currencyStore: d.adaptor.currencyStore
136-
flatNetworksModel: d.adaptor.swapStore.flatNetworks
136+
flatNetworksModel: d.adaptor.networksStore.activeNetworks
137137
processedAssetsModel: d.adaptor.walletAssetsStore.groupedAccountAssetsModel
138138
plainTokensBySymbolModel: plainTokensModel
139139

storybook/qmlTests/tests/tst_BuyReceiveBanner.qml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ Item {
1212
id: buyReceiveComponent
1313
BuyReceiveBanner {
1414
id: banner
15-
anchors.fill: parent
15+
16+
width: root.width
17+
height: implicitHeight
18+
19+
anchors.centerIn: parent
1620

1721
readonly property SignalSpy buyClickedSpy: SignalSpy { target: banner; signalName: "buyClicked" }
1822
readonly property SignalSpy receiveClickedSpy: SignalSpy { target: banner; signalName: "receiveClicked" }
@@ -23,6 +27,9 @@ Item {
2327

2428
TestCase {
2529
id: buyReceiveBannerTest
30+
31+
name: "BuyReceiveBannerTest"
32+
2633
when: windowShown
2734

2835
property BuyReceiveBanner componentUnderTest
@@ -40,7 +47,7 @@ Item {
4047

4148
function test_geometry() {
4249
compare(componentUnderTest.width, root.width)
43-
compare(componentUnderTest.height, root.height)
50+
compare(componentUnderTest.height, 70)
4451
}
4552

4653
function test_buyGeometry() {

storybook/qmlTests/tests/tst_DappsComboBox.qml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ Item {
9090
verify(dappTooltip.height > 0)
9191
verify(dappTooltip.y > controlUnderTest.height)
9292

93-
mouseMove(root)
94-
compare(background.active, false)
95-
compare(dappTooltip.visible, false)
93+
mouseMove(root, 0, 0)
94+
verify(!background.active)
95+
verify(!dappTooltip.visible)
9696
}
9797

9898
function test_clickConnect() {

storybook/qmlTests/tests/tst_SendRecipientInput.qml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Item {
7373
// input's text should be what we typed,
7474
compare(plainText, "0xdeadbeef")
7575
// ... and for each letter pressed the signal `validateInputRequested` should be emitted
76-
compare(signalSpyValidateInputRequested.count, plainText.length)
76+
tryCompare(signalSpyValidateInputRequested, "count", plainText.length)
7777
}
7878

7979
function test_interactive() {
@@ -160,6 +160,8 @@ Item {
160160

161161
controlUnderTest.text = "0xdeadbeef"
162162

163+
waitForRendering(controlUnderTest)
164+
163165
// clear button should be visible with some text
164166
verify(clearButton.visible)
165167
mouseClick(clearButton)

storybook/qmlTests/tests/tst_SimpleSendRecipientInput.qml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ Item {
160160

161161
controlUnderTest.text = "0xdeadbeef"
162162

163+
waitForRendering(controlUnderTest)
164+
163165
// clear button should be visible with some text
164166
verify(clearButton.visible)
165167
mouseClick(clearButton)

storybook/qmlTests/tests/tst_SwapInputPanel.qml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import AppLayouts.Wallet.stores 1.0
1010
import AppLayouts.Wallet.panels 1.0
1111
import AppLayouts.Wallet.popups.swap 1.0
1212
import AppLayouts.Wallet.adaptors 1.0
13+
import AppLayouts.Wallet 1.0
1314

1415
import shared.stores 1.0
1516

@@ -351,7 +352,7 @@ Item {
351352
mouseClick(holdingSelector)
352353
waitForRendering(assetSelectorList)
353354

354-
let delToTest = assetSelectorList.itemAtIndex(i)
355+
const delToTest = findChild(assetSelectorList, "tokenSelectorAssetDelegate_%1".arg(modelItemToTest.name))
355356
verify(!!delToTest)
356357
mouseClick(delToTest)
357358

ui/app/AppLayouts/Wallet/controls/AssetSelector.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Control {
6868
dropdown.close()
6969
}
7070

71-
onSelected: {
71+
onSelected: function(key) {
7272
const entry = ModelUtils.getByKey(root.model, "tokensKey", key)
7373
highlightedKey = key
7474

ui/app/AppLayouts/Wallet/panels/SwapInputPanel.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ Control {
298298
model: d.adaptor.outputAssetsModel
299299
nonInteractiveKey: root.nonInteractiveTokensKey
300300

301-
onSelected: {
301+
onSelected: function(key) {
302302
// Token existance checked with plainTokensBySymbolModel
303303
// This check prevents resetting selection when chain is changed until
304304
// processedAssetsModel is updated
@@ -329,7 +329,7 @@ Control {
329329

330330
visible: d.isSelectedHoldingValidAsset && root.swapSide === SwapInputPanel.SwapSide.Pay
331331

332-
onClicked: {
332+
onClicked: function() {
333333
if (maxSafeValue)
334334
amountToSendInput.setValue(SQUtils.AmountsArithmetic.fromNumber(maxSafeValue).toString())
335335
else

ui/imports/shared/popups/send/controls/SendRecipientInput.qml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ StatusInput {
7979
}
8080
}
8181

82-
Keys.onTabPressed: event.accepted = true
83-
Keys.onReleased: root.validateInputRequested()
82+
Keys.onTabPressed: (event) => {
83+
event.accepted = true
84+
}
85+
Keys.onReleased: (event) => {
86+
event.accepted = true
87+
root.validateInputRequested()
88+
}
8489
}

0 commit comments

Comments
 (0)