1import { AutoFocus, CameraType, FlashMode, WhiteBalance } from '../../Camera.types';
2import { convertNativeProps } from '../props';
3
4describe(convertNativeProps, () => {
5  it(`allows nullish`, () => {
6    expect(convertNativeProps()).toStrictEqual({});
7  });
8  it(`converts known properties to native props`, () => {
9    expect(
10      convertNativeProps({
11        type: CameraType.front,
12        flashMode: FlashMode.torch,
13        autoFocus: AutoFocus.auto,
14        whiteBalance: WhiteBalance.continuous,
15      })
16    ).toStrictEqual({
17      autoFocus: 'auto',
18      flashMode: 'torch',
19      type: 'front',
20      whiteBalance: 'continuous',
21    });
22  });
23  it(`converts unknown properties to undefined values`, () => {
24    expect(
25      convertNativeProps({
26        type: 'invalid',
27        foo: 'bar',
28      } as any)
29    ).toStrictEqual({
30      type: undefined,
31      foo: 'bar',
32    });
33  });
34});
35