How to use the @times-components/jest-serializer.compose function in @times-components/jest-serializer

To help you get started, we’ve selected a few @times-components/jest-serializer 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 / author-profile / __tests__ / shared-with-style.web.js View on Github external
export default () => {
  addSerializers(
    expect,
    compose(
      stylePrinter,
      minimalWebTransform,
      minimaliseTransform(
        (value, key) => key !== "style" && key !== "className"
      ),
      flattenStyleTransform,
      hoistStyleTransform,
      rnwTransform(AppRegistry, styles)
    )
  );

  // eslint-disable-next-line global-require
  require("jest-styled-components");

  const props = {
    analyticsStream() {},
github newsuk / times-components / packages / styleguide / __tests__ / web / serializers.js View on Github external
const { AppRegistry } = require("react-native-web");
const {
  addSerializers,
  compose,
  minimalWebTransform,
  print,
  rnwTransform
} = require("@times-components/jest-serializer");

addSerializers(
  expect,
  compose(
    print,
    minimalWebTransform,
    rnwTransform(AppRegistry)
  )
);

// eslint-disable-next-line global-require
require("jest-styled-components");
github newsuk / times-components / packages / article-lead-asset / __tests__ / shared.js View on Github external
import React from "react";
import TestRenderer from "react-test-renderer";
import {
  addSerializers,
  compose,
  print,
  minimalNativeTransform
} from "@times-components/jest-serializer";
import { iterator } from "@times-components/test-utils";
import shared from "./shared.base";
import ArticleLeadAsset from "../src/article-lead-asset";

addSerializers(
  expect,
  compose(
    print,
    minimalNativeTransform
  )
);

export default () =>
  iterator([
    ...shared(),
    {
      name: "renders correctly when there is no available crop",
      test() {
        const testRenderer = TestRenderer.create(
           null}
            leadAsset={{}}
            width={600}
github newsuk / times-components / packages / article / __tests__ / shared.native.js View on Github external
export default () => {
  addSerializers(
    expect,
    compose(
      print,
      minimalNativeTransform,
      minimaliseTransform((value, key) => omitKeys.has(key))
    )
  );

  const tests = [
    {
      name: "an inline link uses the given onPress",
      test() {
        const onLinkPress = jest.fn();

        const testInstance = TestRenderer.create(
github newsuk / times-components / packages / ad / __tests__ / ad-placeholder-with-style.native.js View on Github external
export default () => {
  addSerializers(
    expect,
    enzymeTreeSerializer(),
    compose(
      print,
      minimalNativeTransform,
      flattenStyleTransform
    )
  );

  it("advert placeholder", () => {
    const testInstance = TestRenderer.create(
      
    );

    expect(testInstance).toMatchSnapshot();
  });
};
github newsuk / times-components / packages / article-main-standard / __tests__ / shared-tablet.native.js View on Github external
export default () => {
  addSerializers(
    expect,
    compose(
      print,
      minimalNativeTransform,
      minimaliseTransform((value, key) => key !== "style"),
      flattenStyleTransform
    )
  );

  const tests = [
    {
      name: "Article Main Standard - Tablet",
      test() {
        setIsTablet(true);

        const testInstance = TestRenderer.create(
github newsuk / times-components / packages / home-page / __tests__ / shared.native.js View on Github external
export default () => {
  addSerializers(
    expect,
    compose(
      print,
      minimalNativeTransform,
      minimaliseTransform((value, key) => key === "style" || key === "testID")
    )
  );

  shared();
};
github newsuk / times-components / packages / article-skeleton / __tests__ / shared.web.js View on Github external
export default () => {
  addSerializers(
    expect,
    enzymeRenderedSerializer(),
    compose(
      print,
      minimalWebTransform,
      minimaliseTransform((value, key) => omitProps.has(key))
    )
  );

  shared(TestRenderer.create);
};
github newsuk / times-components / packages / article-skeleton / __tests__ / header-with-style.native.js View on Github external
export default () => {
  addSerializers(
    expect,
    compose(
      print,
      minimalNativeTransform,
      minimaliseTransform((value, key) => omitKeys.has(key))
    )
  );

  shared(TestRenderer.create);
};
github newsuk / times-components / packages / article-magazine-standard / __tests__ / shared-with-style.web.js View on Github external
export default () => {
  addSerializers(
    expect,
    compose(
      stylePrinter,
      minimalWebTransform,
      minimaliseTransform(
        (value, key) => key !== "style" && key !== "className"
      ),
      flattenStyleTransform,
      hoistStyleTransform,
      rnwTransform(AppRegistry, styles)
    )
  );

  const themeForSection = section => ({
    theme: {
      ...themeFactory(section, "magazinestandard"),
      scale: "medium"
    }