How to use the @times-components/test-utils.iterator function in @times-components/test-utils

To help you get started, we’ve selected a few @times-components/test-utils 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 / article-image / __tests__ / shared.base.js View on Github external
}
        };

        expect(
          makeTest(
            
          )
        ).toMatchSnapshot();
      }
    }
  ];

  iterator(tests);
};
github newsuk / times-components / packages / article-topics / __tests__ / shared.base.js View on Github external
test: () => {
        const testInstance = TestRenderer.create(
           {}}
            slug="test-slug"
          />
        );

        expect(testInstance).toMatchSnapshot();
      }
    }
  ];

  iterator(tests);
};
github newsuk / times-components / packages / article-list / __tests__ / shared-pagination.web.js View on Github external
.find("ArticleListPagination")
          .at(1)
          .dive()
          .find("WithTrackEvents(Pagination)")
          .dive()
          .dive()
          .find("Link")
          .props()
          .onPress();

        spy.mockRestore();
      }
    }
  ];

  iterator(tests);
};
github newsuk / times-components / packages / svgs / __tests__ / shared.js View on Github external
fillOpacity="0.4"
            height="100"
            stroke="rgb(255,255,255)"
            strokeWidth="8"
            width="100"
            x="5"
            y="10"
          />
        );

        expect(testInstance).toMatchSnapshot();
      }
    }
  ];

  iterator(tests);
};
github newsuk / times-components / packages / article-image / __tests__ / shared-with-style.base.js View on Github external
{
      name: "secondary image with caption and credits",
      test: () => {
        expect(
          makeTest(
            
          )
        ).toMatchSnapshot();
      }
    }
  ];

  iterator(tests);
};
github newsuk / times-components / packages / article-list / __tests__ / shared-error.base.native.js View on Github external
const testInstance = TestRenderer.create(
           {}}
            pageSize={3}
            refetch={() => {}}
          />
        );

        expect(testInstance).toMatchSnapshot();
      }
    }
  ];

  iterator(tests);
};
github newsuk / times-components / packages / topic / __tests__ / topic-functional.js View on Github external
{...props}
              analyticsStream={reporter}
              page={1}
              pageSize={pageSize}
            />
          
        );

        const call = reporter.mock.calls[0][0];

        expect(call).toMatchSnapshot();
      }
    }
  ];

  iterator(tests);
};
github newsuk / times-components / packages / article-byline / __tests__ / shared-with-styles.base.js View on Github external
expect(testInstance).toMatchSnapshot();
      }
    },
    {
      name: "with a very long byline",
      test: () => {
        const testInstance = renderArticleByline({
          ast: authorsFixture.veryLongByline
        });

        expect(testInstance).toMatchSnapshot();
      }
    }
  ];

  iterator(tests);
};
github newsuk / times-components / packages / author-profile / __tests__ / author-profile-head.js View on Github external
isLoading: false,
          onTwitterLinkPress: mockOnPress,
          twitter: "testTwitterHandle",
          url: "https://twitter.com/testTwitterHandle"
        };

        const wrapper = shallow();

        wrapper.find("TextLink").simulate("press");

        expect(mockOnPress).toHaveBeenCalled();
      }
    }
  ];

  iterator(tests);
};
github newsuk / times-components / packages / image / __tests__ / shared-native.js View on Github external
},
    {
      name: "handle handlePreviewLoad event if it exists",
      test: () => {
        const wrapper = shallow(<img>);
        const { handlePreviewLoad } = wrapper.instance();
        if (handlePreviewLoad) {
          handlePreviewLoad();

          expect(wrapper.state("isLoaded")).toEqual(true);
        }
      }
    }
  ];

  iterator(tests);
};

@times-components/test-utils

Test helpers for Times Components

BSD-3-Clause
Latest version published 1 month ago

Package Health Score

87 / 100
Full package analysis