2020-02-02 22:34:25 -06:00
|
|
|
/* global describe it cy require expect afterEach*/
|
2020-01-25 13:39:52 -06:00
|
|
|
|
|
|
|
var helper = require('../common/helper');
|
|
|
|
|
|
|
|
describe('Shape operations', function() {
|
2020-02-02 22:34:25 -06:00
|
|
|
|
|
|
|
afterEach(function() {
|
|
|
|
helper.afterAll();
|
|
|
|
});
|
|
|
|
|
2020-01-25 13:39:52 -06:00
|
|
|
it('Insert a simple shape.', function() {
|
2020-02-20 15:01:27 -06:00
|
|
|
helper.loadTestDoc('shape_operations.odt');
|
2020-01-25 13:39:52 -06:00
|
|
|
|
|
|
|
// Scroll on the up toolbar
|
|
|
|
cy.get('#toolbar-up .w2ui-scroll-right').click();
|
|
|
|
cy.get('.w2ui-tb-image.w2ui-icon.basicshapes_ellipse')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
// Insert a rectangle
|
|
|
|
cy.get('.col.w2ui-icon.basicshapes_rectangle')
|
|
|
|
.click({force : true});
|
|
|
|
|
|
|
|
cy.get('.leaflet-pane.leaflet-overlay-pane svg g')
|
|
|
|
.should('exist');
|
|
|
|
|
|
|
|
// Check whether the rectangle was inserted as an SVG
|
|
|
|
cy.get('.leaflet-pane.leaflet-overlay-pane svg')
|
|
|
|
.then(function(svg) {
|
|
|
|
expect(svg[0].getBBox().width).to.be.greaterThan(0);
|
2020-02-08 04:18:57 -06:00
|
|
|
expect(svg[0].getBBox().height).to.be.greaterThan(0);
|
2020-01-25 13:39:52 -06:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|