import { InProductTestCase } from '@atlaskit/in-product-testing';
import { EditorPageObject } from '../../../page-objects/Editor';
import { RendererPageObject } from '../../../page-objects/Renderer';
export const editorTypingTestCase = opts => new InProductTestCase({
  title: 'typing in Editor works',
  id: 'editor-typing',
  assertions: cy => {
    var _opts$ui;
    const editor = new EditorPageObject(cy);
    editor.getEditorArea().type('abcdef');
    editor.getEditorArea().contains('abcdef');
    if (!opts || !((_opts$ui = opts.ui) !== null && _opts$ui !== void 0 && _opts$ui.publishButton)) {
      return;
    }
    const {
      publishButton
    } = opts.ui;
    const renderer = new RendererPageObject(cy);
    cy.get(publishButton).click();
    renderer.getContent().contains('abcdef');
  }
});