Skip to content

Commit

Permalink
constants
Browse files Browse the repository at this point in the history
  • Loading branch information
gbarkhatov committed Sep 9, 2024
1 parent 966d8e3 commit 417a579
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
1 change: 0 additions & 1 deletion e2e/constants/index.ts

This file was deleted.

6 changes: 6 additions & 0 deletions e2e/constants/staking.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { satoshiToBtc } from "@/utils/btcConversions";

export const STAKING_AMOUNT_SAT = 50000;
export const STAKING_AMOUNT_BTC = satoshiToBtc(STAKING_AMOUNT_SAT);
export const STAKING_TX_HASH =
"47af61d63bcc6c513561d9a1198d082052cc07a81f50c6f130653f0a6ecc0fc1";
14 changes: 8 additions & 6 deletions e2e/staking.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { expect, test } from "@playwright/test";

import { STAKING_AMOUNT } from "./constants";
import {
STAKING_AMOUNT_BTC,
STAKING_AMOUNT_SAT,
STAKING_TX_HASH,
} from "./constants/staking";
import { setupWalletConnection } from "./helper/connect";

test.describe("Create staking transaction", () => {
Expand All @@ -17,7 +21,7 @@ test.describe("Create staking transaction", () => {
expect(previewButton).toBeDisabled();

// Preview available after filling the amount
await page.getByPlaceholder("BTC").fill(`${STAKING_AMOUNT}`);
await page.getByPlaceholder("BTC").fill(`${STAKING_AMOUNT_BTC}`);
expect(previewButton).toBeEnabled();

await previewButton.click();
Expand All @@ -44,9 +48,7 @@ test.describe("Create staking transaction", () => {

// Check the staking delegation tx hash and staking value
const [delegation] = parsed;
expect(delegation.stakingValueSat).toBe(50000);
expect(delegation.stakingTxHashHex).toBe(
"47af61d63bcc6c513561d9a1198d082052cc07a81f50c6f130653f0a6ecc0fc1",
);
expect(delegation.stakingValueSat).toBe(STAKING_AMOUNT_SAT);
expect(delegation.stakingTxHashHex).toBe(STAKING_TX_HASH);
});
});

0 comments on commit 417a579

Please sign in to comment.