mirror of https://github.com/lukechilds/polar.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.3 KiB
46 lines
1.3 KiB
import { assertNoConsoleErrors, cleanup, getPageUrl, pageUrl } from './helpers';
|
|
import { Home, NetworkView, NewNetwork } from './pages';
|
|
|
|
fixture`Network`
|
|
.page(pageUrl)
|
|
.beforeEach(Home.clickCreateButton)
|
|
.afterEach(assertNoConsoleErrors)
|
|
.afterEach(cleanup);
|
|
|
|
test('should be on the New Network route', async t => {
|
|
await t.expect(getPageUrl()).match(/.*#\/network$/);
|
|
});
|
|
|
|
test('should add a new network', async t => {
|
|
await t
|
|
.typeText(NewNetwork.nameInput, 'test network')
|
|
.click(NewNetwork.submitBtn)
|
|
.expect(NetworkView.getHeadingTitleText())
|
|
.eql('test network');
|
|
});
|
|
|
|
test('should should view new network after adding', async t => {
|
|
await t
|
|
.typeText(NewNetwork.nameInput, 'test network')
|
|
.click(NewNetwork.submitBtn)
|
|
.expect(getPageUrl())
|
|
.match(/.*#\/network\/1$/);
|
|
});
|
|
|
|
test('should display correct # of LND nodes after adding', async t => {
|
|
await t
|
|
.typeText(NewNetwork.nameInput, 'test network')
|
|
.selectText(NewNetwork.lndNodesInput)
|
|
.typeText(NewNetwork.lndNodesInput, '3')
|
|
.click(NewNetwork.submitBtn)
|
|
.expect(NetworkView.getLndNodeCount())
|
|
.eql(3);
|
|
});
|
|
|
|
test('should display correct # of bitcoind nodes after adding', async t => {
|
|
await t
|
|
.typeText(NewNetwork.nameInput, 'test network')
|
|
.click(NewNetwork.submitBtn)
|
|
.expect(NetworkView.getBitcoindNodeCount())
|
|
.eql(1);
|
|
});
|
|
|