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