2020-02-10 09:28:18 -06:00
|
|
|
/* global describe it cy beforeEach require afterEach*/
|
|
|
|
|
2020-02-12 11:01:47 -06:00
|
|
|
var helper = require('../../common/helper');
|
2020-02-10 09:28:18 -06:00
|
|
|
|
|
|
|
describe('Impress focus tests', function() {
|
|
|
|
beforeEach(function() {
|
2020-02-20 15:01:27 -06:00
|
|
|
helper.beforeAllMobile('focus.odp', 'impress');
|
2020-02-10 09:28:18 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
afterEach(function() {
|
2020-03-13 09:27:33 -05:00
|
|
|
helper.afterAll('focus.odp');
|
2020-02-10 09:28:18 -06:00
|
|
|
});
|
|
|
|
|
2020-02-24 04:54:47 -06:00
|
|
|
it('Basic document focus.', function() {
|
2020-02-10 09:28:18 -06:00
|
|
|
// Click on edit button
|
|
|
|
cy.get('#mobile-edit-button').click();
|
|
|
|
|
|
|
|
cy.get('#tb_actionbar_item_mobile_wizard')
|
|
|
|
.should('not.have.class', 'disabled');
|
|
|
|
|
|
|
|
// Body has the focus -> can't type in the document
|
|
|
|
cy.document().its('activeElement.tagName')
|
|
|
|
.should('be.eq', 'BODY');
|
|
|
|
|
|
|
|
// One tap on a text shape does not grab the focus to the document
|
|
|
|
cy.get('#document-container')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
// Shape selection
|
|
|
|
cy.get('.leaflet-pane.leaflet-overlay-pane svg g')
|
|
|
|
.should('exist');
|
|
|
|
|
|
|
|
// No focus
|
|
|
|
cy.document().its('activeElement.tagName')
|
|
|
|
.should('be.eq', 'BODY');
|
|
|
|
|
|
|
|
// Double tap on a text shape gives the focus to the document
|
|
|
|
cy.get('#document-container')
|
|
|
|
.dblclick();
|
|
|
|
|
|
|
|
// Document has the focus
|
2020-02-24 04:13:19 -06:00
|
|
|
// TODO: Focus is inconsistent here.
|
2020-02-24 04:54:47 -06:00
|
|
|
//cy.document().its('activeElement.className')
|
|
|
|
// .should('be.eq', 'clipboard');
|
2020-02-10 09:28:18 -06:00
|
|
|
});
|
|
|
|
});
|