Skip to content

Commit bc81001

Browse files
authored
Merge pull request #2130 from oasisprotocol/lw/fix-mock-api
Fix Nexus API mocked data to fix making screenshots
2 parents 0f9dcb8 + 5aa2d12 commit bc81001

3 files changed

Lines changed: 28 additions & 33 deletions

File tree

.changelog/2130.trivial.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix Nexus API mocked data to fix making screenshots

playwright/tests/syncTabs.spec.ts

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -319,21 +319,18 @@ test.describe('syncTabs', () => {
319319
await tab2.getByRole('button', { name: /Lock profile/ }).click()
320320
await apiBalance!.fulfill({
321321
body: JSON.stringify({
322-
code: 0,
323-
data: {
324-
address: '',
325-
available: '0',
326-
escrow: '0',
327-
debonding: '0',
328-
nonce: 1,
329-
allowances: [],
330-
delegations_balance: '0',
331-
debonding_delegations_balance: '0',
332-
stats: {
333-
num_txns: 1,
334-
},
335-
} satisfies Account,
336-
}),
322+
address: '',
323+
available: '0',
324+
escrow: '0',
325+
debonding: '0',
326+
nonce: 1,
327+
allowances: [],
328+
delegations_balance: '0',
329+
debonding_delegations_balance: '0',
330+
stats: {
331+
num_txns: 1,
332+
},
333+
} satisfies Account),
337334
})
338335
await page.waitForTimeout(100)
339336

playwright/utils/mockApi.ts

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -126,21 +126,18 @@ export async function mockApiMoreData(context: BrowserContext | Page) {
126126
await context.route('**/consensus/accounts/*', route => {
127127
route.fulfill({
128128
body: JSON.stringify({
129-
code: 0,
130-
data: {
131-
address: route.request().url().split('/consensus/accounts/')[1],
132-
available: '23239060788',
133-
escrow: '100996756163',
134-
debonding: '0',
135-
debonding_delegations_balance: '0',
136-
delegations_balance: '0',
137-
nonce: 70,
138-
allowances: [],
139-
stats: {
140-
num_txns: 1,
141-
},
142-
} satisfies Account,
143-
}),
129+
address: route.request().url().split('/consensus/accounts/')[1],
130+
available: '23239060788',
131+
escrow: '0',
132+
debonding: '0',
133+
debonding_delegations_balance: '0',
134+
delegations_balance: '100996756163',
135+
nonce: 70,
136+
allowances: [],
137+
stats: {
138+
num_txns: 1,
139+
},
140+
} satisfies Account),
144141
})
145142
})
146143
await context.route('**/consensus/accounts/*/delegations', route => {
@@ -150,10 +147,10 @@ export async function mockApiMoreData(context: BrowserContext | Page) {
150147
total_count: 1,
151148
delegations: [
152149
{
153-
amount: '100826130447',
150+
amount: '100996756163',
154151
delegator: 'oasis1qqnk4au603zs94k0d0n7c0hkx8t4p6r87s60axru',
155-
shares: '79562857663',
156-
validator: 'oasis1qp0xuvw2a93w4yp8jwthfz93gxy87u7hes9eu2ev',
152+
shares: '71939343766',
153+
validator: 'oasis1qpn83e8hm3gdhvpfv66xj3qsetkj3ulmkugmmxn3',
157154
},
158155
] satisfies Delegation[],
159156
}),

0 commit comments

Comments
 (0)