test(e2e): make sure e2e tests are passing
This commit is contained in:
parent
e126c58dd8
commit
fda330b566
|
@ -5,6 +5,6 @@ module.exports = class {
|
||||||
}
|
}
|
||||||
|
|
||||||
get() {
|
get() {
|
||||||
return 'test value';
|
return 'TESTNET';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -18,15 +18,19 @@ describe('Startup', () => {
|
||||||
expect(app.client.getTitle()).resolves.toEqual('Zepio');
|
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(
|
test('should show the text "Zepio Starting" in loading screen', async () => {
|
||||||
expect.stringContaining('Zepio Starting'),
|
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(
|
test('should show the zcash logo in loading screen', () => expect(
|
||||||
expect.stringContaining('/assets/zcash-simple-icon.svg'),
|
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', () => {
|
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);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -14,6 +14,6 @@ afterAll(() => app.stop());
|
||||||
|
|
||||||
describe('Status Pill', () => {
|
describe('Status Pill', () => {
|
||||||
test('should show status pill in the header', async () => expect(
|
test('should show status pill in the header', async () => expect(
|
||||||
app.client.waitUntilTextExists('#status-pill', 'ready').getText('#status-pill'),
|
app.client.waitUntilTextExists('#status-pill', 'READY', 30000).getText('#status-pill'),
|
||||||
).resolves.toEqual(expect.stringContaining('ready')));
|
).resolves.toEqual(expect.stringContaining('READY')));
|
||||||
});
|
});
|
||||||
|
|
|
@ -21,7 +21,7 @@ const handler = (server) => {
|
||||||
|
|
||||||
switch (method) {
|
switch (method) {
|
||||||
case 'getinfo':
|
case 'getinfo':
|
||||||
sleep(1500).then(() => res.send({ result: { version: 1.0 } }));
|
sleep(500).then(() => res.send({ result: { version: 1.0 } }));
|
||||||
break;
|
break;
|
||||||
case 'getblockchaininfo':
|
case 'getblockchaininfo':
|
||||||
return res.send({ result: { verificationprogress: 1 } });
|
return res.send({ result: { verificationprogress: 1 } });
|
||||||
|
@ -43,7 +43,7 @@ const handler = (server) => {
|
||||||
});
|
});
|
||||||
case 'z_sendmany':
|
case 'z_sendmany':
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
sleep(2000).then(() => {
|
sleep(1000).then(() => {
|
||||||
const [, [obj], amount, fee] = req.body.params;
|
const [, [obj], amount, fee] = req.body.params;
|
||||||
|
|
||||||
if ((obj.address[0] === 'z' || obj.address[0] === 't') && amount > 0) {
|
if ((obj.address[0] === 'z' || obj.address[0] === 't') && amount > 0) {
|
||||||
|
@ -109,6 +109,8 @@ const handler = (server) => {
|
||||||
return res.send({
|
return res.send({
|
||||||
result: 10,
|
result: 10,
|
||||||
});
|
});
|
||||||
|
case 'ping':
|
||||||
|
return res.send(null);
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
// @flow
|
// @flow
|
||||||
|
import electron from 'electron'; // eslint-disable-line
|
||||||
import { isTestnet } from '../../config/is-testnet';
|
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';
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in New Issue