wisemapping-frontend/packages/editor/cypress/integration/topicShape.test.js

51 lines
1.6 KiB
JavaScript

context('Change Topic shape', () => {
beforeEach(() => {
cy.visit('/editor.html');
cy.reload();
cy.contains('Try it Now!').click();
});
it('change to square shape', () => {
cy.get('#topicShapeTip').click();
cy.get('#rectagle').click();
cy.get('[test-id=11] > rect').each((element, index, $list) => {
cy.get($list[1]).invoke('attr', 'rx').should('eq', '0');
});
cy.matchImageSnapshot('changeToSquareShape');
});
it('change to rounded rectagle', () => {
cy.get('#topicShapeTip').click();
// TODO: The parameter {force: true} was placed because it does not detect that the element is visible
cy.get('#rounded_rectagle').click({ force: true });
cy.get('[test-id=11] > rect').each((element, index, $list) => {
cy.get($list[1]).invoke('attr', 'rx').should('eq', '4.6499999999999995');
});
cy.matchImageSnapshot('changeToRoundedRectagle');
});
it('change to line', () => {
cy.get('#topicShapeTip').click();
// TODO: The parameter {force: true} was placed because it does not detect that the element is visible
cy.get('#line').click({ force: true });
cy.matchImageSnapshot('changeToLine');
});
it('change to elipse shape', () => {
cy.get('#topicShapeTip').click();
// TODO: The parameter {force: true} was placed because it does not detect that the element is visible
cy.get('#elipse').click({ force: true });
cy.get('[test-id=11] > rect').each((element, index, $list) => {
cy.get($list[1]).invoke('attr', 'rx').should('eq', '13.950000000000001');
});
cy.matchImageSnapshot('changeToElipseShape');
});
});