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 const switchToUrlTestCase = ({
  ui,
  url
}) => new InProductTestCase({
  title: 'switching to a Blue Link works',
  id: 'switch-to-url',
  assertions: cy => {
    const editor = new EditorPageObject(cy);
    const editorWithSmartLinks = new EditorSmartLinkPageObject(cy, editor);
    const inlineCard = new InlineCardPageObject(cy);
    editorWithSmartLinks.insertSmartLinkByTyping(url);
    editorWithSmartLinks.switchAfterInsert('url');
    inlineCard.assertHrefRendered(url);
    if (ui !== null && ui !== void 0 && ui.publishButton) {
      const renderer = editor.publish(ui);
      renderer.expectContentReady();
      inlineCard.assertHrefRendered(url);
    }
  }
});