File tree Expand file tree Collapse file tree 2 files changed +24
-18
lines changed
src/components/CloseButton Expand file tree Collapse file tree 2 files changed +24
-18
lines changed Original file line number Diff line number Diff line change @@ -3,33 +3,27 @@ import { Image } from 'react-native';
33
44import styled from '@stream-io/styled-components' ;
55
6- import { themed } from '../../styles/theme' ;
76import closeRound from '../../images/icons/close-round.png' ;
87
8+ import { themed } from '../../styles/theme' ;
9+
910const Container = styled . View `
10- width: 30;
11- height: 30;
12- border-radius: 3;
1311 align-items: center;
14- justify-content: center;
1512 background-color: white;
1613 border: 1px solid rgba(0, 0, 0, 0.1);
14+ border-radius: 3px;
15+ height: 30px;
16+ justify-content: center;
17+ width: 30px;
1718 ${ ( { theme } ) => theme . closeButton . container . css }
1819` ;
1920
20- const CloseButton = themed (
21- class CloseButton extends React . PureComponent {
22- static themePath = 'closeButton' ;
23- render ( ) {
24- return (
25- < Container >
26- < Image source = { closeRound } />
27- </ Container >
28- ) ;
29- }
30- } ,
21+ const CloseButton = ( ) => (
22+ < Container >
23+ < Image source = { closeRound } testID = 'close-button' />
24+ </ Container >
3125) ;
3226
33- CloseButton . propTypes = { } ;
27+ CloseButton . themePath = 'closeButton' ;
3428
35- export default CloseButton ;
29+ export default themed ( CloseButton ) ;
Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+ import { render , wait } from '@testing-library/react-native' ;
3+
4+ import CloseButton from '../CloseButton' ;
5+
6+ describe ( 'CloseButton' , ( ) => {
7+ it ( 'should render a CloseButton' , async ( ) => {
8+ const { queryByTestId } = render ( < CloseButton /> ) ;
9+
10+ await wait ( ( ) => expect ( queryByTestId ( 'close-button' ) ) . toBeTruthy ( ) ) ;
11+ } ) ;
12+ } ) ;
You can’t perform that action at this time.
0 commit comments