2020-02-28 02:20:23 +04:00
|
|
|
const commonUtils = require('./common-utils');
|
|
|
|
|
|
|
|
const API_HOST = commonUtils.API_HOST;
|
|
|
|
|
|
|
|
const runCommandAndGetOutputFor = commonUtils.runCommandAndGetOutputFor;
|
|
|
|
const clearText = commonUtils.clearText;
|
|
|
|
|
|
|
|
const COMMAND = 'deploy';
|
|
|
|
const COMMAND_ENDPOINT = 'deploy';
|
|
|
|
|
|
|
|
async function deploy() {
|
|
|
|
return await runCommandAndGetOutputFor(COMMAND, COMMAND_ENDPOINT);
|
|
|
|
}
|
|
|
|
|
|
|
|
describe('Deploy contract', () => {
|
|
|
|
beforeAll(() => jest.setTimeout(60000));
|
|
|
|
|
|
|
|
beforeEach(async () => await page.goto(API_HOST));
|
|
|
|
|
|
|
|
it('should deploy', async done => {
|
2020-03-07 01:58:50 +04:00
|
|
|
expect(await deploy()).toContain('The contract was successfully deployed to the carthage test network.');
|
2020-02-28 02:20:23 +04:00
|
|
|
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should fail to deploy contract with invalid storage', async done => {
|
|
|
|
await page.click('#command-select');
|
|
|
|
await page.click(`#deploy`);
|
|
|
|
|
|
|
|
await page.click(`#storage`);
|
|
|
|
await clearText(page.keyboard);
|
|
|
|
await page.keyboard.type('asdf');
|
|
|
|
|
|
|
|
expect(await deploy()).toContain('Error: ');
|
|
|
|
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|