All files / stories/MDX/MDXFileWithExternalTests index.cy.tsx

100% Statements 8/8
100% Branches 0/0
100% Functions 3/3
100% Lines 8/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23              2x         2x 2x 2x 2x 2x 2x   2x      
import { composeStories } from "@storybook/react";
import * as sbPreview from "dot-storybook/preview";
import React from "react";
import { stubStoryActions } from "orphic-cypress";
// @ts-ignore
import * as stories from "./index.stories.mdx";
 
const { mdxFileWithExternalTests: MdxFileWithExternalTests } = composeStories(
  stories,
  sbPreview
);
 
describe("External test file", () => {
  it("should contain the external label", () => {
    const actions = stubStoryActions(MdxFileWithExternalTests, stories);
    cy.mount(<MdxFileWithExternalTests {...actions} />);
    cy.dataCy("button").should("contain", "In MDX");
    cy.dataCy("button")
      .click()
      .then(() => expect(actions.onClick).to.be.calledOnceWith(0));
  });
});