Skip to content

Commit

Permalink
update simulateTx
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeesun Kim authored and Jeesun Kim committed Dec 10, 2024
1 parent e737ded commit 2f07981
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/app/(sidebar)/transaction/simulate/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ export default function SimulateTransaction() {
/>

<Input
data-testid="simulate-tx-instr-leeway"
id="simulate-tx-instr-leeway"
fieldSize="md"
label="Instruction Leeway"
Expand Down
13 changes: 7 additions & 6 deletions tests/simulateTransactionPage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ test.describe("Simulate Transaction Page", () => {

test.describe("Instruction Leeway Input", () => {
test("error when inputting a non whole number", async ({ page }) => {
const instructionLeewayOn = page.getByTestId("simulate-tx-instr-leeway");
const instructionLeewayOn = page.getByLabel("Instruction Leeway");
await instructionLeewayOn.fill("aaa");
await expect(page.getByText("Expected a whole number.")).toBeVisible();
});

test("previous response should be removed when inputting a non whole number", async ({
page,
}) => {
const instructionLeewayOn = page.getByLabel("Instruction Leeway");

// Getting a success response
const xdrInput = page.getByLabel(
"Input a base-64 encoded TransactionEnvelope",
Expand Down Expand Up @@ -60,7 +62,6 @@ test.describe("Simulate Transaction Page", () => {
await expect(txResponseCard).toBeVisible();

// Typing in the wrong instruction leeway should remove the previous response
const instructionLeewayOn = page.getByTestId("simulate-tx-instr-leeway");
await instructionLeewayOn.fill("aaa");
await expect(page.getByText("Expected a whole number.")).toBeVisible();

Expand All @@ -79,7 +80,7 @@ test.describe("Simulate Transaction Page", () => {

await expect(simulateTxBtn).toBeDisabled();

const instructionLeewayOn = page.getByTestId("simulate-tx-instr-leeway");
const instructionLeewayOn = page.getByLabel("Instruction Leeway");
await instructionLeewayOn.fill("23423423");

// inputting the leeway alone isn't enough to enable the simulate tx button
Expand Down Expand Up @@ -233,9 +234,9 @@ test.describe("Simulate Transaction Page", () => {
});
});

// // =============================================================================
// // Mock data
// // =============================================================================
// =============================================================================
// Mock data
// =============================================================================
const MOCK_SC_VAL_XDR =
"AAAAEQAAAAEAAAAGAAAADwAAAAZhbW91bnQAAAAAAAoAAAAAAAAAAAAACRhOcqAAAAAADwAAAAxib290c3RyYXBwZXIAAAASAAAAARssFqxD/prgmYc9vGkaqslWrGlPINzMYTLc4yqRfO3AAAAADwAAAAxjbG9zZV9sZWRnZXIAAAADAz6ilAAAAA8AAAAIcGFpcl9taW4AAAAKAAAAAAAAAAAAAAARdlkuAAAAAA8AAAAEcG9vbAAAABIAAAABX/a7xfliM8nFgGel6pbCM6fT/kqrHAITNtWZQXgDlIIAAAAPAAAAC3Rva2VuX2luZGV4AAAAAAMAAAAA";

Expand Down

0 comments on commit 2f07981

Please sign in to comment.