status-desktop/storybook/qmlTests/tests/tst_TokenSelectorButton.qml

45 lines
997 B
QML
Raw Permalink Normal View History

2024-09-18 11:11:16 +00:00
import QtQuick 2.15
import QtTest 1.15
import AppLayouts.Wallet.controls 1.0
import Storybook 1.0
Item {
id: root
width: 600
height: 400
Component {
id: buttonCmp
TokenSelectorButton {
name: "ETH"
icon: ""
}
}
TestCase {
name: "TokenSelectorButton"
when: windowShown
function test_notSelected() {
const button = createTemporaryObject(buttonCmp, root)
verify(TestUtils.findTextItem(button, button.text))
verify(!TestUtils.findTextItem(button, "ETH"))
verify(findChild(button, "notSelectedContent"))
}
function test_selected() {
const button = createTemporaryObject(buttonCmp, root)
button.selected = true
verify(!TestUtils.findTextItem(button, button.text))
verify(TestUtils.findTextItem(button, "ETH"))
verify(findChild(button, "selectedContent"))
}
}
}