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