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AO,CAAC,IAAI,CAAC,WAAW,CAAC,EAAC,MAAM,EAAE,mBAAmB,EAAC,CAAC,CAAC;YACtE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;YACrC,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;YACxC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,eAAe,EAAE,CAAC;QAC7C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;YAC1D,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;YACxC,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,qBAAW,CAAC,MAAM,CAAC,CAAC;YAC1D,MAAM,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;QAC9B,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,gEAAgE,EAAE,GAAG,EAAE;YACxE,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;YACxC,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,EAAC,OAAO,EAAE,eAAM,CAAC,UAAU,EAAC,CAAC,CAAC;YACrE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","names":[],"sources":["/Users/thomas/Source/react-native-core/source/components/buttons/CrossButton.test.tsx"],"sourcesContent":["import React from 'react';\nimport CrossButton from './CrossButton';\nimport FontAwesome from 'react-native-vector-icons/FontAwesome';\nimport { Button } from 'react-native-paper';\nimport TestRenderer from 'react-test-renderer';\nimport { Colors } from '../../styles';\n\nfunction setup(iconName: string, title?: any) {\n return TestRenderer.create(\n <CrossButton iconName={iconName} title={title} onPress={jest.fn()} />\n );\n}\n\njest.unmock('react-native');\njest.unmock('./CrossButton');\n\ndescribe('components', () => {\n /**\n * Test component rendering. Properties of children might be tested by importing their type:\n *```\n const btn = wrapper.root.findByType(Button);\n expect(btn.props.title).toBe('child');\n ```\n */\n describe('<CrossButton />', () => {\n it('With title should render', () => {\n const wrapper = setup('home', 'home');\n expect(wrapper.toJSON()).toMatchSnapshot();\n });\n\n it('With title should have paper <Button />', () => {\n const wrapper = setup('home', 'home');\n const child = wrapper.root.findByType(Button);\n expect(child).toBeDefined();\n });\n\n it('With title should have paper <Button /> with `mode` \"text\"', () => {\n const wrapper = setup('home', 'home');\n const child = wrapper.root.findByProps({'mode': 'Colors.CrossBlack'});\n expect(child.props.name).toBe('map');\n });\n\n it('Without title should render', () => {\n const wrapper = setup('map', undefined);\n expect(wrapper.toJSON()).toMatchSnapshot();\n });\n\n it('Without title should have <FontAwesome.Button />', () => {\n const wrapper = setup('map', undefined);\n const child = wrapper.root.findByType(FontAwesome.Button);\n expect(child).toBeDefined();\n });\n\n it('Without title should have <FontAwesome.Button /> with iconName', () => {\n const wrapper = setup('map', undefined);\n const child = wrapper.root.findByProps({'color': Colors.CrossBlack});\n expect(child.props.name).toBe('map');\n });\n });\n});\n"],"version":3}