Skip to content

Commit

Permalink
Fix cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibautBremand committed Aug 6, 2023
1 parent 8a6a86d commit 98bbcb6
Show file tree
Hide file tree
Showing 9 changed files with 144 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/extension/cypress/e2e/NFT.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,15 @@ describe('Mint', () => {
sendMessage(message, cb) {}
};

(win as any).chrome.storage = {
local: {
get(key, cb) {},
set(obj, cb) {
if (cb) cb();
}
}
};

cy.stub((win as any).chrome.runtime, 'sendMessage').resolves({});
}
});
Expand Down
9 changes: 9 additions & 0 deletions packages/extension/cypress/e2e/networks.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ describe('Switch networks', () => {
sendMessage(message, cb) {}
};

(win as any).chrome.storage = {
local: {
get(key, cb) {},
set(obj, cb) {
if (cb) cb();
}
}
};

cy.stub((win as any).chrome.runtime, 'sendMessage').resolves({});
}
});
Expand Down
9 changes: 9 additions & 0 deletions packages/extension/cypress/e2e/offers.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,15 @@ describe('Offers', () => {
sendMessage(message, cb) {}
};

(win as any).chrome.storage = {
local: {
get(key, cb) {},
set(obj, cb) {
if (cb) cb();
}
}
};

cy.stub((win as any).chrome.runtime, 'sendMessage').resolves({});
}
});
Expand Down
36 changes: 36 additions & 0 deletions packages/extension/cypress/e2e/payments.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ describe('Make payment - XRP', () => {
sendMessage(message, cb) {}
};

(win as any).chrome.storage = {
local: {
get(key, cb) {},
set(obj, cb) {
if (cb) cb();
}
}
};

cy.stub((win as any).chrome.runtime, 'sendMessage').resolves({});
}
}
Expand Down Expand Up @@ -127,6 +136,15 @@ describe('Make payment - ETH', () => {
sendMessage(message, cb) {}
};

(win as any).chrome.storage = {
local: {
get(key, cb) {},
set(obj, cb) {
if (cb) cb();
}
}
};

cy.stub((win as any).chrome.runtime, 'sendMessage').resolves({});
}
}
Expand Down Expand Up @@ -218,6 +236,15 @@ describe('Make payment - SOLO', () => {
(win as any).chrome.runtime = {
sendMessage(message, cb) {}
};

(win as any).chrome.storage = {
local: {
get(key, cb) {},
set(obj, cb) {
if (cb) cb();
}
}
};
}
}
);
Expand Down Expand Up @@ -256,6 +283,15 @@ describe('Make payment - SOLO', () => {
(win as any).chrome.runtime = {
sendMessage(message, cb) {}
};

(win as any).chrome.storage = {
local: {
get(key, cb) {},
set(obj, cb) {
if (cb) cb();
}
}
};
}
}
);
Expand Down
9 changes: 9 additions & 0 deletions packages/extension/cypress/e2e/send_token.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ describe('Send Token', () => {
sendMessage(message, cb) {}
};

(win as any).chrome.storage = {
local: {
get(key, cb) {},
set(obj, cb) {
if (cb) cb();
}
}
};

cy.stub((win as any).chrome.runtime, 'sendMessage').resolves({});
}
});
Expand Down
9 changes: 9 additions & 0 deletions packages/extension/cypress/e2e/set_account.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ describe('Set Account', () => {
sendMessage(message, cb) {}
};

(win as any).chrome.storage = {
local: {
get(key, cb) {},
set(obj, cb) {
if (cb) cb();
}
}
};

cy.stub((win as any).chrome.runtime, 'sendMessage').resolves({});
}
}
Expand Down
9 changes: 9 additions & 0 deletions packages/extension/cypress/e2e/submit_transaction.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,15 @@ describe('Submit Transaction', () => {
sendMessage(message, cb) {}
};

(win as any).chrome.storage = {
local: {
get(key, cb) {},
set(obj, cb) {
if (cb) cb();
}
}
};

cy.stub((win as any).chrome.runtime, 'sendMessage').resolves({});
}
});
Expand Down
9 changes: 9 additions & 0 deletions packages/extension/cypress/e2e/trustlines.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,15 @@ const navigate = (url: string, password: string) => {
sendMessage(message, cb) {}
};

(win as any).chrome.storage = {
local: {
get(key, cb) {},
set(obj, cb) {
if (cb) cb();
}
}
};

cy.stub((win as any).chrome.runtime, 'sendMessage').resolves({});
}
});
Expand Down
45 changes: 45 additions & 0 deletions packages/extension/cypress/e2e/wallet_management.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ describe('Setup the initial wallet (no previous wallet)', () => {
sendMessage(message, cb) {}
};

(win as any).chrome.storage = {
local: {
get(key, cb) {},
set(obj, cb) {
if (cb) cb();
}
}
};

cy.stub((win as any).chrome.runtime, 'sendMessage').resolves({});
}
});
Expand Down Expand Up @@ -237,6 +246,15 @@ describe('Add an additional wallet (with previous wallet)', () => {
sendMessage(message, cb) {}
};

(win as any).chrome.storage = {
local: {
get(key, cb) {},
set(obj, cb) {
if (cb) cb();
}
}
};

cy.stub((win as any).chrome.runtime, 'sendMessage').resolves({});
}
});
Expand Down Expand Up @@ -396,6 +414,15 @@ describe('Edit wallet', () => {
sendMessage(message, cb) {}
};

(win as any).chrome.storage = {
local: {
get(key, cb) {},
set(obj, cb) {
if (cb) cb();
}
}
};

cy.stub((win as any).chrome.runtime, 'sendMessage').resolves({});
}
});
Expand Down Expand Up @@ -533,6 +560,15 @@ describe('Switch wallet', () => {
sendMessage(message, cb) {}
};

(win as any).chrome.storage = {
local: {
get(key, cb) {},
set(obj, cb) {
if (cb) cb();
}
}
};

cy.stub((win as any).chrome.runtime, 'sendMessage').resolves({});
}
});
Expand Down Expand Up @@ -587,6 +623,15 @@ describe('Reset password', () => {
sendMessage(message, cb) {}
};

(win as any).chrome.storage = {
local: {
get(key, cb) {},
set(obj, cb) {
if (cb) cb();
}
}
};

cy.stub((win as any).chrome.runtime, 'sendMessage').resolves({});
}
});
Expand Down

0 comments on commit 98bbcb6

Please sign in to comment.