"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.insertInlineSmartLinkTestCase = void 0;
var _inProductTesting = require("@atlaskit/in-product-testing");
var _inProduct = require("@atlaskit/smart-card/in-product");
var _Editor = require("../../../../page-objects/Editor");
var _EditorSmartLink = require("../../../../page-objects/EditorSmartLink");
var insertInlineSmartLinkTestCase = exports.insertInlineSmartLinkTestCase = function insertInlineSmartLinkTestCase(_ref) {
  var ui = _ref.ui,
    url = _ref.url;
  return new _inProductTesting.InProductTestCase({
    title: 'inserting an Inline Smart Link works',
    id: 'inline-smart-link-insert',
    assertions: function assertions(cy) {
      var editor = new _Editor.EditorPageObject(cy);
      var editorWithSmartLinks = new _EditorSmartLink.EditorSmartLinkPageObject(cy, editor);
      editorWithSmartLinks.insertSmartLinkByTyping(url);
      (0, _inProduct.inlineSmartLinkRendersTestCase)({
        url: url
      }).assertions(cy);
      if (ui !== null && ui !== void 0 && ui.publishButton) {
        var renderer = editor.publish(ui);
        renderer.expectContentReady();
        (0, _inProduct.inlineSmartLinkRendersTestCase)({
          url: url
        }).assertions(cy);
      }
    }
  });
};