How to use the @times-components/jest-serializer.minimaliseTransform 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 / article-comments / __tests__ / shared.js View on Github external
export default () => {
  addSerializers(
    expect,
    compose(
      print,
      minimalNativeTransform,
      minimaliseTransform((value, key) => omitKeys.has(key))
    )
  );

  shared();

  it("zero comments", () => {
    const testInstance = renderComments({ count: 0, enabled: true });
    expect(testInstance).toMatchSnapshot();
  });

  it("single comment", () => {
    const testInstance = renderComments({ count: 1, enabled: true });
    expect(testInstance).toMatchSnapshot();
  });
};
github newsuk / times-components / packages / article-magazine-standard / __tests__ / shared-with-style.native.js View on Github external
export default () => {
  addSerializers(
    expect,
    compose(
      print,
      minimalNativeTransform,
      minimaliseTransform((value, key) => key !== "style"),
      flattenStyleTransform
    )
  );

  it("phone full article with style", () => {
    const testRenderer = TestRenderer.create(
      
    );

    expect(testRenderer).toMatchSnapshot();
  });

  it("tablet full article with style", () => {
    setIsTablet(true);
    const testRenderer = TestRenderer.create(
github newsuk / times-components / packages / image / __tests__ / modal-shared.native.js View on Github external
export default () => {
  addSerializers(
    expect,
    compose(
      print,
      minimalNativeTransform,
      minimaliseTransform(
        (value, key) => key === "style" || key === "nativeBackgroundAndroid"
      ),
      replacePropTransform((value, key) => (key === "d" ? hash(value) : value))
    )
  );

  const props = {
    aspectRatio: 2,
    caption: ,
    uri: "http://example.com/image.jpg?crop=1016%2C677%2C0%2C0"
  };

  const tests = [
    {
      name: "modal image",
      async test() {
github newsuk / times-components / packages / gradient / __tests__ / shared-fill.native.js View on Github external
export default () => {
  addSerializers(
    expect,
    compose(
      print,
      minimaliseTransform((value, key) => key !== "fill"),
      minimalNativeTransform
    )
  );

  const tests = [
    {
      name: "gradient with no angle",
      test() {
        const testInstance = TestRenderer.create();

        expect(testInstance).toMatchSnapshot();
      }
    },
    {
      name: "gradient with an angle (-45)",
      test() {
github newsuk / times-components / packages / ad / __tests__ / ad-placeholder.shared.js View on Github external
export default () => {
  addSerializers(
    expect,
    compose(
      print,
      minimaliseTransform((value, key) => key === "style"),
      minimalNativeTransform
    )
  );

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

    expect(testInstance).toMatchSnapshot();
  });
};
github newsuk / times-components / packages / slice-layout / __tests__ / serializers.native.js View on Github external
import {
  addSerializers,
  compose,
  minimalNativeTransform,
  minimaliseTransform,
  print
} from "@times-components/jest-serializer";

addSerializers(
  expect,
  compose(
    print,
    minimalNativeTransform,
    minimaliseTransform((value, key) => key === "style")
  )
);
github newsuk / times-components / packages / article-flag / __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-image / __tests__ / shared.web.js View on Github external
export default () => {
  addSerializers(
    expect,
    enzymeRenderedSerializer(),
    compose(
      print,
      replaceTransform({
        ArticleImage: justChildren,
        ArticleImageWeb: justChildren,
        Caption: justChildren,
        TimesImage: propsNoChildren,
        ...meltNative
      }),
      minimalWebTransform,
      minimaliseTransform(
        (value, key) => key === "style" || key === "className"
      ),
      rnwTransform(AppRegistry)
    )
  );

  shared(component => mount(component));
};
github newsuk / times-components / packages / slice-layout / __tests__ / serializers-with-style.native.js View on Github external
import {
  addSerializers,
  compose,
  flattenStyleTransform,
  minimalNativeTransform,
  minimaliseTransform,
  print
} from "@times-components/jest-serializer";

addSerializers(
  expect,
  compose(
    print,
    minimalNativeTransform,
    minimaliseTransform((value, key) => key !== "style"),
    flattenStyleTransform
  )
);
github newsuk / times-components / packages / interactive-wrapper / __tests__ / shared.js View on Github external
const omitProps = new Set([
  "javaScriptEnabled",
  "messagingEnabled",
  "saveFormDataDisabled",
  "scalesPageToFit",
  "thirdPartyCookiesEnabled"
]);

addSerializers(
  expect,
  compose(
    print,
    flattenStyleTransform,
    minimalNativeTransform,
    minimaliseTransform((value, key) => omitProps.has(key))
  )
);

export default () => shared();