-
Notifications
You must be signed in to change notification settings - Fork 42
/
shared.js
44 lines (39 loc) · 927 Bytes
/
shared.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import {
addSerializers,
compose,
print,
minimaliseTransform,
minimalNativeTransform
} from "@times-components/jest-serializer";
import shared from "./shared-base";
import renderComments from "./renderer";
const omitKeys = new Set([
"data",
"disableVirtualization",
"horizontal",
"onViewableItemsChanged",
"selectable",
"style",
"testID",
"viewabilityConfig",
"viewabilityConfigCallbackPairs"
]);
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();
});
};