Skip to content

Commit 0448acb

Browse files
committed
claim assertions working
1 parent 78d2d04 commit 0448acb

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

e2e/specs/predict/predict-claim-positions.spec.ts

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ import {
1414
POLYMARKET_REMOVE_CLAIMED_POSITIONS_MOCKS,
1515
POLYMARKET_TRANSACTION_SENTINEL_MOCKS,
1616
POLYMARKET_UPDATE_USDC_BALANCE_MOCKS,
17+
POLYMARKET_ADD_CLAIMED_POSITIONS_TO_ACTIVITY_MOCKS,
1718
} from '../../api-mocking/mock-responses/polymarket/polymarket-mocks';
1819
import { Mockttp } from 'mockttp';
1920
import { setupRemoteFeatureFlagsMock } from '../../api-mocking/helpers/remoteFeatureFlagsHelper';
2021
import PredictClaimPage from '../../pages/Predict/PredictClaimPage';
2122
import TabBarComponent from '../../pages/wallet/TabBarComponent';
2223
import ActivitiesView from '../../pages/Transactions/ActivitiesView';
2324
import PredictActivityDetails from '../../pages/Transactions/predictionsActivityDetails';
24-
// import WalletActionsBottomSheet from '../../pages/wallet/WalletActionsBottomSheet';
2525
import {
2626
POLYMARKET_RESOLVED_LOST_POSITIONS_RESPONSE,
2727
POLYMARKET_WINNING_POSITIONS_RESPONSE,
@@ -60,7 +60,7 @@ describe(SmokePredictions('Predictions'), () => {
6060
await PredictHelpers.setPortugalLocation();
6161
await loginToApp();
6262

63-
// Claim button is animated - disabling sync to prevent test hang
63+
// Claim button is animated - disabling sync on iOS to prevent test hang
6464
await device.disableSynchronization();
6565

6666
await WalletView.tapOnPredictionsTab();
@@ -72,15 +72,18 @@ describe(SmokePredictions('Predictions'), () => {
7272
await WalletView.tapClaimButton();
7373
await Assertions.expectElementToBeVisible(PredictClaimPage.container);
7474

75-
// Set up mocks to remove claimed positions after tapping claim button
76-
await POLYMARKET_REMOVE_CLAIMED_POSITIONS_MOCKS(mockServer);
77-
await POLYMARKET_UPDATE_USDC_BALANCE_MOCKS(mockServer, 'claim');
78-
7975
await PredictClaimPage.tapClaimConfirmButton();
80-
await device.enableSynchronization();
76+
77+
await POLYMARKET_UPDATE_USDC_BALANCE_MOCKS(mockServer, 'claim');
78+
await POLYMARKET_REMOVE_CLAIMED_POSITIONS_MOCKS(mockServer);
79+
await POLYMARKET_ADD_CLAIMED_POSITIONS_TO_ACTIVITY_MOCKS(mockServer);
8180

8281
await Assertions.expectElementToBeVisible(WalletView.container);
82+
await device.enableSynchronization();
8383

84+
await Assertions.expectElementToNotBeVisible(WalletView.claimButton, {
85+
description: 'Claim button should not be visible',
86+
});
8487
/*
8588
Verify that all resolved positions (lost positions + winning positions) are removed after claiming
8689
Resolved positions include both:
@@ -98,10 +101,6 @@ describe(SmokePredictions('Predictions'), () => {
98101
});
99102
}
100103

101-
await Assertions.expectElementToNotBeVisible(WalletView.claimButton, {
102-
description: 'Claim button should not be visible',
103-
});
104-
105104
await TabBarComponent.tapActivity();
106105

107106
await ActivitiesView.tapOnPredictionsTab();
@@ -123,9 +122,11 @@ describe(SmokePredictions('Predictions'), () => {
123122
}
124123

125124
await TabBarComponent.tapWallet();
126-
// await TabBarComponent.tapActions();
127-
// await WalletActionsBottomSheet.tapPredictButton();
128-
// await Assertions.expectTextDisplayed('$48.16');
125+
126+
// Verify balance on iOS only. Android balances take a while to refresh.
127+
if (device.getPlatform() === 'ios') {
128+
await Assertions.expectTextDisplayed('$48.16');
129+
}
129130
},
130131
);
131132
});

0 commit comments

Comments
 (0)