diff --git a/__mocks__/electron-store.js b/__mocks__/electron-store.js index 18b7e97..3f3f9c3 100644 --- a/__mocks__/electron-store.js +++ b/__mocks__/electron-store.js @@ -5,6 +5,6 @@ module.exports = class { } get() { - return 'test value'; + return 'TESTNET'; } }; diff --git a/__tests__/e2e/startup.test.js b/__tests__/e2e/startup.test.js index f443062..007aadb 100644 --- a/__tests__/e2e/startup.test.js +++ b/__tests__/e2e/startup.test.js @@ -18,15 +18,19 @@ describe('Startup', () => { expect(app.client.getTitle()).resolves.toEqual('Zepio'); }); - test('should show the text "Zepio Starting" in loading screen', async () => expect(app.client.element('#loading-screen:first-child p').getHTML()).resolves.toEqual( - expect.stringContaining('Zepio Starting'), - )); + test('should show the text "Zepio Starting" in loading screen', async () => { + expect( + app.client.element('div[data-testid~="LoadingScreen"]:first-child p').getHTML(), + ).resolves.toEqual(expect.stringContaining('Zepio Starting')); + }); - test('should show the zcash logo in loading screen', () => expect(app.client.getAttribute('#loading-screen:first-child img', 'src')).resolves.toEqual( - expect.stringContaining('/assets/zcash-simple-icon.svg'), - )); + test('should show the zcash logo in loading screen', () => expect( + app.client.getAttribute('div[data-testid~="LoadingScreen"]:first-child img', 'src'), + ).resolves.toEqual(expect.stringContaining('/assets/zcash-simple-icon.svg'))); test('should show the loading circle in loading screen', () => { - expect(app.client.element('#loading-screen svg').isExisting()).resolves.toEqual(true); + expect( + app.client.element('div[data-testid~="LoadingScreen"] svg').isExisting(), + ).resolves.toEqual(true); }); }); diff --git a/__tests__/e2e/status-pill.test.js b/__tests__/e2e/status-pill.test.js index 2bba343..39c0267 100644 --- a/__tests__/e2e/status-pill.test.js +++ b/__tests__/e2e/status-pill.test.js @@ -14,6 +14,6 @@ afterAll(() => app.stop()); describe('Status Pill', () => { test('should show status pill in the header', async () => expect( - app.client.waitUntilTextExists('#status-pill', 'ready').getText('#status-pill'), - ).resolves.toEqual(expect.stringContaining('ready'))); + app.client.waitUntilTextExists('#status-pill', 'READY', 30000).getText('#status-pill'), + ).resolves.toEqual(expect.stringContaining('READY'))); }); diff --git a/__tests__/setup/mockAPI.js b/__tests__/setup/mockAPI.js index 023a574..029abc5 100644 --- a/__tests__/setup/mockAPI.js +++ b/__tests__/setup/mockAPI.js @@ -21,7 +21,7 @@ const handler = (server) => { switch (method) { case 'getinfo': - sleep(1500).then(() => res.send({ result: { version: 1.0 } })); + sleep(500).then(() => res.send({ result: { version: 1.0 } })); break; case 'getblockchaininfo': return res.send({ result: { verificationprogress: 1 } }); @@ -43,7 +43,7 @@ const handler = (server) => { }); case 'z_sendmany': // eslint-disable-next-line - sleep(2000).then(() => { + sleep(1000).then(() => { const [, [obj], amount, fee] = req.body.params; if ((obj.address[0] === 'z' || obj.address[0] === 't') && amount > 0) { @@ -109,6 +109,8 @@ const handler = (server) => { return res.send({ result: 10, }); + case 'ping': + return res.send(null); default: return null; } diff --git a/app/utils/get-coin-name.js b/app/utils/get-coin-name.js index 2a723d1..6717e5a 100644 --- a/app/utils/get-coin-name.js +++ b/app/utils/get-coin-name.js @@ -1,4 +1,9 @@ // @flow +import electron from 'electron'; // eslint-disable-line import { isTestnet } from '../../config/is-testnet'; -export const getCoinName = () => (isTestnet() ? 'TAZ' : 'ZEC'); +export const getCoinName = () => { + if (electron.remote.process.env.NODE_ENV === 'test' || isTestnet()) return 'TAZ'; + + return 'ZEC'; +};