Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default () => {
addSerializers(
expect,
compose(
print,
minimalWebTransform,
minimaliseTransform(
(value, key) => key === "style" || key === "className"
),
replacePropTransform((value, key) => (key === "d" ? hash(value) : value))
)
);
// eslint-disable-next-line global-require
require("jest-styled-components");
const tests = [
{
name: "an invalid uri",
test: () => {
const testRenderer = TestRenderer.create(
<img>
);
expect(testRenderer).toMatchSnapshot();
}
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();
});
};
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() {
const testInstance = TestRenderer.create();
await act(async () => {
export default () => {
addSerializers(
expect,
enzymeRenderedSerializer(),
compose(
print,
replaceTransform({
svg: justChildren
}),
minimaliseTransform((value, key) => key !== "fill" && key !== "stroke"),
replacePropTransform(
(value, key) =>
longKeysSet.has(key) ? hash(JSON.stringify(value)) : value
)
)
);
shared(mount);
};
flattenStyleTransform,
minimalWebTransform,
print,
replacePropTransform
} from "@times-components/jest-serializer";
import { hash } from "@times-components/test-utils";
const longValues = new Set(["points"]);
addSerializers(
expect,
compose(
print,
flattenStyleTransform,
minimalWebTransform,
replacePropTransform(
(value, key) =>
longValues.has(key) ? hash(JSON.stringify(value)) : value
)
)
);
export default () => {
addSerializers(
expect,
compose(
print,
flattenStyleTransform,
minimaliseTransform((value, key) => key === "opacity"),
replacePropTransform(
(value, key) =>
longKeysSet.has(key) ? hash(JSON.stringify(value)) : value
)
)
);
shared(TestRenderer.create);
};
export default () => {
addSerializers(
expect,
enzymeRenderedSerializer(),
compose(
print,
replaceTransform({
svg: propsNoChildren
}),
minimaliseTransform((value, key) => key === "style" || key === "viewBox"),
replacePropTransform(
(value, key) =>
longKeysSet.has(key) ? hash(JSON.stringify(value)) : value
)
)
);
shared(mount);
};
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,
highResSize: 900,
uri: "http://example.com/image.jpg?crop=1016%2C677%2C0%2C0",
relativeWidth: 0.5,
relativeHeight: 0.4,
relativeHorizontalOffset: 0.16666666666666666,
relativeVerticalOffset: 0.2
};
const tests = [
{
name: "prepend https schema",
export default () => {
addSerializers(
expect,
enzymeRenderedSerializer(),
compose(
print,
minimaliseTransform((value, key) => key === "style"),
replacePropTransform(
(value, key) =>
longKeysSet.has(key) ? hash(JSON.stringify(value)) : value
)
)
);
shared(mount);
};
export default () => {
addSerializers(
expect,
enzymeRenderedSerializer(),
compose(
print,
minimalNativeTransform,
minimaliseTransform(
(value, key) =>
key === "style" ||
key === "nativeBackgroundAndroid" ||
key.includes("Class")
),
replacePropTransform((value, key) => {
if (key === "uri") {
return hash(value);
}
if (key === "source" && value.uri) {
return hash(value.uri);
}
return value;
})
)
);
const tests = [
{
name: "video",
test: () => {
const testInstance = TestRenderer.create(