"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.deleteBlockSmartLinkTestCase = void 0;
var _inProductTesting = require("@atlaskit/in-product-testing");
var _inProduct = require("@atlaskit/smart-card/in-product");
var _Editor = require("../../../../page-objects/Editor");
var _EditorSmartLink = require("../../../../page-objects/EditorSmartLink");
var deleteBlockSmartLinkTestCase = exports.deleteBlockSmartLinkTestCase = function deleteBlockSmartLinkTestCase(_ref) {
  var ui = _ref.ui,
    url = _ref.url;
  return new _inProductTesting.InProductTestCase({
    title: 'able to delete a Block Smart Link using floating toolbar',
    id: 'delete-block-smart-link',
    assertions: function assertions(cy) {
      var editor = new _Editor.EditorPageObject(cy);
      var editorWithSmartLinks = new _EditorSmartLink.EditorSmartLinkPageObject(cy, editor);
      var blockCard = new _inProduct.BlockCardPageObject(cy);
      editorWithSmartLinks.insertSmartLinkByTyping(url);
      editorWithSmartLinks.switchAfterInsert('block');
      (0, _inProduct.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();
      }
    }
  });
};