import { InProductTestCase } from '@atlaskit/in-product-testing';
import { blockSmartLinkRendersTestCase } from '@atlaskit/smart-card/in-product';
import { EditorPageObject } from '../../../../page-objects/Editor';
import { EditorSmartLinkPageObject } from '../../../../page-objects/EditorSmartLink';
export var switchToBlockSmartLinkTestCase = function switchToBlockSmartLinkTestCase(_ref) {
  var ui = _ref.ui,
    url = _ref.url;
  return new InProductTestCase({
    title: 'switching to a Block Smart Link works',
    id: 'switch-to-block',
    assertions: function assertions(cy) {
      var editor = new EditorPageObject(cy);
      var editorWithSmartLinks = new EditorSmartLinkPageObject(cy, editor);
      editorWithSmartLinks.insertSmartLinkByTyping(url);
      editorWithSmartLinks.switchAfterInsert('block');
      blockSmartLinkRendersTestCase({
        url: url
      }).assertions(cy);
      if (ui !== null && ui !== void 0 && ui.publishButton) {
        var renderer = editor.publish(ui);
        renderer.expectContentReady();
        blockSmartLinkRendersTestCase({
          url: url
        }).assertions(cy);
      }
    }
  });
};