mirror of
https://github.com/zhigang1992/wallet.git
synced 2026-01-12 22:53:27 +08:00
test: deletes fairly useless test relying on external factors
This commit is contained in:
@@ -138,7 +138,7 @@ export function SignIn() {
|
||||
key={i}
|
||||
value={mnemonic[i] ?? ''}
|
||||
onPasteEntireKey={key => {
|
||||
(document.activeElement as any)?.blur();
|
||||
(document.activeElement as HTMLInputElement).blur();
|
||||
updateEntireKey(key);
|
||||
}}
|
||||
onUpdateWord={w => mnemonicWordUpdate(i, w)}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
export enum BalanceSelectors {
|
||||
StacksToken = 'Stacks',
|
||||
RocketToken = 'rocket-token',
|
||||
StellaToken = 'stella-token',
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
import { BalanceSelectors } from '@tests-legacy/integration/balance.selectors';
|
||||
import { BrowserDriver, createTestSelector, setupBrowser } from '@tests-legacy/integration/utils';
|
||||
import { SECRET_KEY_2 } from '@tests-legacy/mocks';
|
||||
import { WalletPage } from '@tests-legacy/page-objects/wallet.page';
|
||||
|
||||
import { RouteUrls } from '@shared/route-urls';
|
||||
|
||||
jest.setTimeout(60_000);
|
||||
jest.retryTimes(process.env.CI ? 2 : 0);
|
||||
|
||||
const getAmount = (stxAmount: string) => (stxAmount ? parseFloat(stxAmount.replace(/,/g, '')) : 0);
|
||||
|
||||
describe(`balance integration tests`, () => {
|
||||
const BEFORE_ALL_TIMEOUT = 60000;
|
||||
let browser: BrowserDriver;
|
||||
let wallet: WalletPage;
|
||||
|
||||
beforeAll(async () => {
|
||||
browser = await setupBrowser();
|
||||
wallet = await WalletPage.init(browser, RouteUrls.Onboarding);
|
||||
await wallet.signIn(SECRET_KEY_2);
|
||||
}, BEFORE_ALL_TIMEOUT);
|
||||
|
||||
afterAll(async () => {
|
||||
try {
|
||||
await browser.context.close();
|
||||
} catch (error) {}
|
||||
});
|
||||
|
||||
it('checks Stacks Token balance is greater than 0', async () => {
|
||||
const stxAmount = await wallet.page.textContent(
|
||||
createTestSelector(BalanceSelectors.StacksToken)
|
||||
);
|
||||
const actualAmount = stxAmount && getAmount(stxAmount);
|
||||
expect(actualAmount).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user