From 86491291564d72926473ccbd5e02d5d7777ac39b Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Thu, 26 Mar 2026 14:51:35 +0200 Subject: [PATCH] feat: something --- tests/wallets/index.html | 333 +++++++++++++++++++++++++++++---------- 1 file changed, 250 insertions(+), 83 deletions(-) diff --git a/tests/wallets/index.html b/tests/wallets/index.html index 34516af2d..ed10cfe82 100644 --- a/tests/wallets/index.html +++ b/tests/wallets/index.html @@ -774,6 +774,64 @@ gap: 12px; } + .test-type-tabs { + margin-top: 8px; + border-radius: 18px; + background: rgba(22, 32, 40, 0.04); + padding: 6px; + } + + .test-type-tabs .q-tab { + flex: 1 1 0; + min-width: 0; + } + + .test-type-panels { + margin-top: 14px; + background: transparent; + box-shadow: none; + } + + .test-type-panel { + padding: 0; + } + + .test-case-stack { + display: grid; + gap: 14px; + } + + .test-case-section { + display: grid; + gap: 14px; + } + + .test-case-section + .test-case-section { + padding-top: 18px; + border-top: 1px solid rgba(25, 54, 61, 0.08); + } + + .test-case-header { + display: flex; + gap: 12px; + align-items: flex-start; + justify-content: space-between; + } + + .test-case-title { + margin: 0; + font-size: 1rem; + line-height: 1.25; + font-weight: 800; + } + + .test-case-subtitle { + margin-top: 4px; + color: var(--studio-muted); + font-size: 0.84rem; + line-height: 1.45; + } + .mock-card { border-radius: 16px; border: 1px solid rgba(25, 54, 61, 0.08); @@ -1469,102 +1527,138 @@

Tests For Selected Function

- Each card shows the raw test case for the selected function, plus the mocks attached to the selected funding source. + Browse the raw test types for this function, then inspect the call params, expected result, and selected funding source mocks.
-
-
+ - -
- -
-

- {{ testEntry.description || `Test ${testEntry.index + 1}` }} -

-
-
+
{{ group.label }}
+ + -
- - {{ testEntry.status.label }} - - - {{ currentFundingSource.name }} - - - {{ testEntry.variantCount }} generated variants - -
-
- -
-
- {{ testEntry.note }} -
- -
-
- -
-
- -
-
- -
-
-
-
-
{{ mockSet.label }}
+ + +
+
+
+
+

+ {{ + `${group.label} ${entryIndex + 1}` + }} +

+
+ Raw test {{ testEntry.index + 1 }}
- - {{ Object.keys(mockSet.value || {}).length }} mock names -
- +
+ + {{ testEntry.status.label }} + + + {{ currentFundingSource.name }} + + + {{ testEntry.variantCount }} generated variants + +
+
+ +
+ {{ testEntry.note }} +
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+
{{ mockSet.label }}
+
+ + {{ Object.keys(mockSet.value || {}).length }} mock names + +
+ + +
+
+ +
+ No wallet-specific mock entry is defined for + {{ currentFundingSource.name }} + in this test.
- -
- No wallet-specific mock entry is defined for - {{ currentFundingSource.name }} - in this test. -
-
-
+ + -
+
No tests are defined for this function.
@@ -2138,6 +2232,7 @@ settingsDraftRowId: 0, settingsDrafts, selectedDatasetKey: 'rest', + selectedTestTypeByScope: {}, selectedFunctionByDataset, selectedFundingSourceByDataset } @@ -2325,6 +2420,78 @@ expectedLabel: test.expect ? 'Expect' : 'Expect Error' } }) + }, + currentTestTypeScopeKey() { + if (!this.currentFunctionName || !this.currentFundingSourceName) { + return '' + } + + return [ + this.selectedDatasetKey, + this.currentFunctionName, + this.currentFundingSourceName + ].join(':') + }, + currentFunctionTestTypeGroups() { + const groups = [] + const groupMap = new Map() + + this.currentFunctionTestsForFundingSource.forEach(testEntry => { + const label = + (testEntry.description || `Test ${testEntry.index + 1}`).trim() || + `Test ${testEntry.index + 1}` + + if (!groupMap.has(label)) { + const group = { + key: label, + label, + entries: [], + totalVariants: 0 + } + groupMap.set(label, group) + groups.push(group) + } + + const group = groupMap.get(label) + group.entries.push(testEntry) + group.totalVariants += testEntry.variantCount + }) + + return groups + }, + currentSelectedTestTypeKey: { + get() { + const scopeKey = this.currentTestTypeScopeKey + if (!scopeKey) { + return '' + } + + const selectedKey = this.selectedTestTypeByScope[scopeKey] + if ( + selectedKey && + this.currentFunctionTestTypeGroups.some( + group => group.key === selectedKey + ) + ) { + return selectedKey + } + + return this.currentFunctionTestTypeGroups[0]?.key || '' + }, + set(value) { + if (!this.currentTestTypeScopeKey) { + return + } + + this.selectedTestTypeByScope[this.currentTestTypeScopeKey] = value + } + }, + currentSelectedTestTypeGroup() { + return ( + this.currentFunctionTestTypeGroups.find( + group => group.key === this.currentSelectedTestTypeKey + ) || null + ) } }, watch: {