mirror of
https://github.com/logos-blockchain/lez-programs.git
synced 2026-08-25 22:21:16 +00:00
fix(liquidity): retain confirmation after failure
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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, {
|
||||
|
||||
Reference in New Issue
Block a user