171babc2c9
* feat/1010: Show proposal rejected reason in transaction dialog * feat/1010: Show wallet rejection details in transaction dialog * Feat/1010: Updated wallet types * Feat/1010: Ensuring rejected proposals get the correct transaction dialog title * Feat/1010: Fixing linting warning * Feat/1010: Skipping node switcher tests for now
75 lines
2.5 KiB
JavaScript
75 lines
2.5 KiB
JavaScript
const nodeErrorType = 'node-error-type';
|
|
const nodeErrorMsg = 'node-error-message';
|
|
const nodeId = 'node-url-0';
|
|
const customNodeBtn = 'custom-node';
|
|
|
|
context.skip('Node switcher', function () {
|
|
beforeEach('visit home page', function () {
|
|
cy.intercept('GET', 'https://static.vega.xyz/assets/capsule-network.json', {
|
|
hosts: ['http://localhost:3028/query'],
|
|
}).as('nodeData');
|
|
cy.visit('/');
|
|
cy.wait('@nodeData');
|
|
cy.getByTestId('git-network-data').within(() => {
|
|
cy.getByTestId('link').should('be.visible').click();
|
|
});
|
|
});
|
|
|
|
describe('form validations and responses', function () {
|
|
it('node data is displayed', function () {
|
|
cy.getByTestId('node-row').should('have.length.at.least', 2);
|
|
|
|
cy.getByTestId('node-row')
|
|
.eq(0)
|
|
.within(() => {
|
|
cy.getByTestId(nodeId)
|
|
.should('exist')
|
|
.and('have.attr', 'aria-checked', 'true');
|
|
cy.get('label').should('have.text', Cypress.env('networkQueryUrl'));
|
|
cy.getByTestId('ssl-cell').should('have.text', 'Checking');
|
|
cy.getByTestId('ssl-cell', { timeout: 6000 }).should(
|
|
'not.have.text',
|
|
'Checking'
|
|
);
|
|
cy.getByTestId('response-time-cell').should('contain.text', 'ms');
|
|
cy.getByTestId('block-cell').should('not.be.empty');
|
|
});
|
|
});
|
|
|
|
it('cannot connect to network using invalid url', function () {
|
|
const errorTypeTxt = 'Error: invalid url';
|
|
const nodeErrorTxt = 'fakeUrl is not a valid url.';
|
|
|
|
cy.getByTestId('node-url-custom').click();
|
|
|
|
cy.getByTestId(customNodeBtn).within(() => {
|
|
cy.get('input').clear().type('fakeUrl');
|
|
cy.getByTestId('link').click();
|
|
});
|
|
validateNodeError(errorTypeTxt, nodeErrorTxt);
|
|
});
|
|
|
|
it('Cannot connect to network from different chain ID', function () {
|
|
const errorTypeTxt = 'Error: incorrect network';
|
|
const nodeErrorTxt = 'This node is not on the CUSTOM network.';
|
|
|
|
cy.getByTestId('node-url-custom').click();
|
|
|
|
cy.getByTestId(customNodeBtn).within(() => {
|
|
cy.get('input').clear().type('https://n03.s.vega.xyz/query');
|
|
cy.getByTestId('link').click();
|
|
});
|
|
cy.getByTestId('ssl-cell', { timeout: 6000 }).should(
|
|
'contain.text',
|
|
'Yes'
|
|
);
|
|
validateNodeError(errorTypeTxt, nodeErrorTxt);
|
|
});
|
|
|
|
function validateNodeError(errortype, errorMsg) {
|
|
cy.getByTestId(nodeErrorType).should('have.text', errortype);
|
|
cy.getByTestId(nodeErrorMsg).should('have.text', errorMsg);
|
|
}
|
|
});
|
|
});
|