Skip to content

Commit

Permalink
Addressing PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ypolishchuk-ledger committed Dec 18, 2024
1 parent fea5b35 commit b74592b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
10 changes: 8 additions & 2 deletions apps/ledger-live-desktop/tests/specs/speculos/nft.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { CLI } from "tests/utils/cliUtils";
import invariant from "invariant";

test.describe("send NFT to ENS address", () => {
const originalValue = process.env.DISABLE_TRANSACTION_BROADCAST;

test.beforeAll(async () => {
process.env.DISABLE_TRANSACTION_BROADCAST = "1";
});
Expand Down Expand Up @@ -57,8 +59,12 @@ test.describe("send NFT to ENS address", () => {
},
);

test.afterAll(async () => {
delete process.env.DISABLE_TRANSACTION_BROADCAST;
test.afterAll(() => {
if (originalValue !== undefined) {
process.env.DISABLE_TRANSACTION_BROADCAST = originalValue;
} else {
delete process.env.DISABLE_TRANSACTION_BROADCAST;
}
});
});

Expand Down
4 changes: 0 additions & 4 deletions apps/ledger-live-desktop/tests/specs/speculos/send.tx.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,6 @@ test.describe("Send flows", () => {

for (const transaction of transactionE2E) {
test.describe("Send from 1 account to another", () => {
test.beforeAll(async () => {
process.env.DISABLE_TRANSACTION_BROADCAST = "0";
});

test.use({
userdata: "skip-onboarding",
speculosApp: transaction.transaction.accountToDebit.currency.speculosApp,
Expand Down
8 changes: 7 additions & 1 deletion apps/ledger-live-desktop/tests/specs/speculos/swap.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ const swaps = [

for (const { swap, xrayTicket } of swaps) {
test.describe("Swap - Accepted (without tx broadcast)", () => {
const originalValue = process.env.DISABLE_TRANSACTION_BROADCAST;

test.beforeAll(async () => {
process.env.SWAP_DISABLE_APPS_INSTALL = "true";
process.env.SWAP_API_BASE = "https://swap-stg.ledger-test.com/v5";
Expand All @@ -203,7 +205,11 @@ for (const { swap, xrayTicket } of swaps) {
test.afterAll(async () => {
delete process.env.SWAP_DISABLE_APPS_INSTALL;
delete process.env.SWAP_API_BASE;
delete process.env.DISABLE_TRANSACTION_BROADCAST;
if (originalValue !== undefined) {
process.env.DISABLE_TRANSACTION_BROADCAST = originalValue;
} else {
delete process.env.DISABLE_TRANSACTION_BROADCAST;
}
});

test.use({
Expand Down

0 comments on commit b74592b

Please sign in to comment.