fix(liquidity): retain confirmation after failure

This commit is contained in:
Ricardo Guilherme Schmidt
2026-07-18 19:56:57 -03:00
parent 40f1705a5e
commit 342f21d37d
2 changed files with 45 additions and 0 deletions
+5
View File
@@ -255,6 +255,10 @@ Item {
function onConfirmationQuoteReady(snapshot) {
confirmationDialog.updateSnapshot(snapshot)
}
function onSubmitSucceeded() {
confirmationDialog.close()
}
}
Component {
@@ -278,6 +282,7 @@ Item {
confirmEnabled: snapshot.quoteReady === true
&& newPositionFlow.walletCanSubmit
roundedCancelButton: true
closeWhenSettled: false
summary: liquidityConfirmationSummary
onSummaryEdited: function(snapshot) {
+40
View File
@@ -232,6 +232,46 @@ TestCase {
tryCompare(dialog, "opened", false)
}
function test_submissionFailureKeepsConfirmationOpenForRetry() {
var backend = createTemporaryObject(backendComponent, testCase, {
"deferSubmitResult": true
})
var page = createTemporaryObject(pageComponent, testCase, {
"backend": backend,
"visible": true
})
verify(page)
var dialog = findChild(page, "liquidityConfirmationDialog")
verify(dialog)
dialog.openWithSnapshot({
"quoteReady": true,
"request": ({}),
"quoteHash": "sha256:expected"
})
tryCompare(dialog, "opened", true)
dialog.confirm()
tryCompare(page.flow, "submitting", true)
backend.newPositionSubmitResult = {
"schema": "new-position.v2",
"status": "error",
"code": "wallet_submission_failed",
"quote": {
"schema": "new-position.v2",
"status": "ok",
"canSubmit": true,
"quoteHash": "sha256:retry"
},
"requestId": page.flow.submitRequestId
}
tryCompare(page.flow, "submitting", false)
tryCompare(dialog, "opened", true)
compare(dialog.confirmationPending, false)
}
function test_destinationRequoteUsesQuoteBusyText() {
var backend = createTemporaryObject(backendComponent, testCase)
var page = createTemporaryObject(pageComponent, testCase, {