"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.editorTypingTestCase = void 0;
var _inProductTesting = require("@atlaskit/in-product-testing");
var _Editor = require("../../../page-objects/Editor");
var _Renderer = require("../../../page-objects/Renderer");
var editorTypingTestCase = exports.editorTypingTestCase = function editorTypingTestCase(opts) {
  return new _inProductTesting.InProductTestCase({
    title: 'typing in Editor works',
    id: 'editor-typing',
    assertions: function assertions(cy) {
      var _opts$ui;
      var editor = new _Editor.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;
      }
      var publishButton = opts.ui.publishButton;
      var renderer = new _Renderer.RendererPageObject(cy);
      cy.get(publishButton).click();
      renderer.getContent().contains('abcdef');
    }
  });
};