test(e2e): make sure e2e tests are passing

This commit is contained in:
George Lima 2019-05-30 12:45:01 -03:00
parent e126c58dd8
commit fda330b566
5 changed files with 24 additions and 13 deletions

View File

@ -5,6 +5,6 @@ module.exports = class {
}
get() {
return 'test value';
return 'TESTNET';
}
};

View File

@ -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);
});
});

View File

@ -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')));
});

View File

@ -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;
}

View File

@ -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';
};