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