"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.deleteEmbedSmartLinkTestCase = 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 deleteEmbedSmartLinkTestCase = exports.deleteEmbedSmartLinkTestCase = function deleteEmbedSmartLinkTestCase(_ref) {
  var ui = _ref.ui,
    url = _ref.url;
  return new _inProductTesting.InProductTestCase({
    title: 'able to delete an Embed Smart Link using floating toolbar',
    id: 'delete-embed-smart-link',
    assertions: function assertions(cy) {
      var editor = new _Editor.EditorPageObject(cy);
      var editorWithSmartLinks = new _EditorSmartLink.EditorSmartLinkPageObject(cy, editor);
      var embedCard = new _inProduct.EmbedCardPageObject(cy);
      editorWithSmartLinks.insertSmartLinkByTyping(url);
      editorWithSmartLinks.switchAfterInsert('embed');
      (0, _inProduct.embedSmartLinkRendersTestCase)({
        url: url
      }).assertions(cy);
      editorWithSmartLinks.deleteSmartLink('embed');
      embedCard.expectCardNotExists();
      if (ui !== null && ui !== void 0 && ui.publishButton) {
        var renderer = editor.publish(ui);
        renderer.expectContentReady();
        embedCard.expectCardNotExists();
      }
    }
  });
};