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