How to use the @times-components/jest-serializer.enzymeTreeSerializer 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 / watermark / __tests__ / shared.js View on Github external
export default () => {
  addSerializers(
    expect,
    enzymeTreeSerializer(),
    compose(
      print,
      minimalNativeTransform,
      replacePropTransform((value, key) => (key === "d" ? hash(value) : value))
    )
  );

  it("1. watermark", () => {
    const wrapper = shallow();

    expect(wrapper).toMatchSnapshot();
  });
};
github newsuk / times-components / packages / button / __tests__ / shared.native.js View on Github external
export default () => {
  addSerializers(
    expect,
    enzymeTreeSerializer(),
    compose(
      print,
      minimaliseTransform((value, key) => key.startsWith("accessibility")),
      minimalNativeTransform,
      flattenStyleTransform
    )
  );

  it("should handle the onPress event", () => {
    const onPressMock = jest.fn();
    const wrapper = shallow(
      <button title="test button">
    );

    wrapper.simulate("press");
</button>
github newsuk / times-components / packages / ad / __tests__ / ad-placeholder-with-style.native.js View on Github external
export default () =&gt; {
  addSerializers(
    expect,
    enzymeTreeSerializer(),
    compose(
      print,
      minimalNativeTransform,
      flattenStyleTransform
    )
  );

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

    expect(testInstance).toMatchSnapshot();
  });
};
github newsuk / times-components / packages / edition-slices / __tests__ / shared-slices.web.js View on Github external
export default () => {
  addSerializers(
    expect,
    enzymeTreeSerializer(),
    compose(
      print,
      minimalWebTransform,
      minimaliseTransform(
        (value, key) => key === "style" || key === "className" || key === "tile"
      ),
      rnwTransform(AppRegistry)
    )
  );

  shared();
};
github newsuk / times-components / packages / card / __tests__ / web / serializers.js View on Github external
export default () => {
  addSerializers(
    expect,
    enzymeTreeSerializer(),
    compose(
      stylePrinter,
      replaceTransform({
        CardComponent: justChildren,
        CardContent: justChildren,
        Gradient: propsNoChildren,
        Loading: justChildren,
        TimesImage: propsNoChildren,
        ...meltNative
      }),
      flattenStyleTransform,
      hoistStyleTransform,
      minimalWebTransform,
      rnwTransform(AppRegistry, styles)
    )
  );
github newsuk / times-components / packages / article / __tests__ / images.web.js View on Github external
export default () => {
  addSerializers(
    expect,
    enzymeTreeSerializer(),
    compose(
      print,
      minimalWebTransform,
      minimaliseTransform((value, key) => omitProps.has(key))
    )
  );

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

  beforeEach(() => {
    const nuk = {
      user: {
        isLoggedIn: true
      }
    };
    global.nuk = nuk;
  });
github newsuk / times-components / packages / edition-slices / __tests__ / tile-aa / shared-tile-aa.web.js View on Github external
export default () => {
  addSerializers(
    expect,
    enzymeTreeSerializer(),
    compose(
      stylePrinter,
      hoistStyleTransform,
      minimalWebTransform,
      minimaliseTransform((value, key) => key === "style"),
      rnwTransform(AppRegistry, [
        "color",
        "flexWrap",
        "fontFamily",
        "fontSize",
        "fontWeight",
        "lineHeight",
        "marginBottom"
      ])
    )
  );
github newsuk / times-components / packages / markup / __tests__ / shared-ad.web.js View on Github external
export default () =&gt; {
  addSerializers(
    expect,
    enzymeTreeSerializer(),
    compose(
      stylePrinter,
      flattenStyleTransform,
      replaceTransform({
        Ad: propsNoChildren,
        AdComposer: justChildren,
        Broadcast: justChildren,
        ...meltNative
      }),
      rnwTransform()
    )
  );

  shared(component =&gt; mount({component}));
};
github newsuk / times-components / packages / article-list / __tests__ / web / serializers.js View on Github external
const {
  addSerializers,
  compose,
  enzymeTreeSerializer,
  flattenStyleTransform,
  minimalWebTransform,
  rnwTransform,
  stylePrinter
} = require("@times-components/jest-serializer");

addSerializers(
  expect,
  enzymeTreeSerializer(),
  compose(
    stylePrinter,
    flattenStyleTransform,
    minimalWebTransform,
    rnwTransform()
  )
);