Skip to content

Commit

Permalink
Storybook: OnboardingLayout page - add seed phrase verification auto-…
Browse files Browse the repository at this point in the history
…fill
  • Loading branch information
micieslak authored and caybro committed Jan 2, 2025
1 parent 1c52488 commit 733685f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
18 changes: 18 additions & 0 deletions storybook/pages/OnboardingLayoutPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,24 @@ SplitView {
focusPolicy: Qt.NoFocus
onClicked: ClipboardUtils.setText(mockDriver.mnemonic)
}
Button {
text: "Paste seed phrase verification"
focusPolicy: Qt.NoFocus
onClicked: {
for (let i = 0;; i++) {
const input = StorybookUtils.findChild(
onboarding.stack.currentItem,
`seedInput_${i}`)

if (input === null)
break

const index = input.seedWordIndex
input.text = mockDriver.seedWords[index]
}
}
}

Button {
text: "Copy PIN (\"%1\")".arg(ctrlPin.text)
focusPolicy: Qt.NoFocus
Expand Down
6 changes: 6 additions & 0 deletions storybook/src/Storybook/StorybookUtils.qml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ QtObject {
for (let i = 0; i < parent.children.length; i++) {
if (parent.children[i].objectName === name)
return parent.children[i]

const inner = findChild(parent.children[i], name)

if (inner !== null)
return inner
}

return null
}
}

0 comments on commit 733685f

Please sign in to comment.