How to use the @times-components/fixture-generator.MockArticle function in @times-components/fixture-generator

To help you get started, we’ve selected a few @times-components/fixture-generator examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github newsuk / times-components / packages / ssr / __tests__ / helpers / article-helper.js View on Github external
it("does not have SpotIM comment tag when article comments are disabled", () => {
      const articleWithCommentsDisabled = new MockArticle()
        .sundayTimes()
        .setCommentsEnabled(false)
        .get();

      cy.task("startMockServerWith", {
        Article: articleWithCommentsDisabled,
        User: userWithBookmarks
      }).visit("/article/8763d1a0-ca57-11e8-bde6-fae32479843d");

      cy.get("script[data-spotim-module]").should("not.exist");
    });
github newsuk / times-components / packages / ssr / __tests__ / helpers / article-helper.js View on Github external
it("has SpotIM comment tag when article comments are enabled", () => {
      const articleWithCommentsEnabled = new MockArticle()
        .sundayTimes()
        .setCommentsEnabled(true)
        .get();

      cy.task("startMockServerWith", {
        Article: articleWithCommentsEnabled,
        User: userWithBookmarks
      }).visit("/article/8763d1a0-ca57-11e8-bde6-fae32479843d");

      cy.get("script[data-spotim-module]")
        .should("have.attr", "src", "https://launcher.spot.im/spot/5p0t_1m_1d")
        .should("have.attr", "data-post-id", articleWithCommentsEnabled.id)
        .should(
          "have.attr",
          "data-post-url",
          `https://www.thetimes.co.uk/article/${articleWithCommentsEnabled.id}`
github newsuk / times-components / packages / ssr / __tests__ / integration / author-profile.js View on Github external
before(() =>
    cy.task("startMockServerWith", {
      Article: new MockArticle().get(),
      Author: new MockAuthor().setAuthorArticles(35).get()
    })
  );
github newsuk / times-components / packages / ssr / __tests__ / integration / topic.js View on Github external
before(() => {
    cy.task("startMockServerWith", {
      Article: new MockArticle().get(),
      Topic: new MockTopic().setTopicArticles(25).get()
    });
  });