mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-30 01:24:55 +01:00
51 lines
1.6 KiB
JavaScript
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');
|
||
|
});
|
||
|
});
|