File tree Expand file tree Collapse file tree 2 files changed +23
-11
lines changed Expand file tree Collapse file tree 2 files changed +23
-11
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import * as React from 'react' ;
2+ import * as ReactDOM from 'react-dom' ;
3+ import Flag from '../src' ;
4+
5+ describe ( 'Flag' , ( ) => {
6+ it ( 'renders without crashing' , ( ) => {
7+ const div = document . createElement ( 'div' ) ;
8+ ReactDOM . render ( < Flag role = "button" /> , div ) ;
9+ ReactDOM . unmountComponentAtNode ( div ) ;
10+ } ) ;
11+ it ( 'renders text when country code is unrecognized' , async ( ) => {
12+ const div = document . createElement ( 'div' ) ;
13+ ReactDOM . render ( < Flag country = "USSR" size = { 16 } /> , div ) ;
14+ expect ( div . innerHTML ) . toBe ( '<span>USSR</span>' ) ;
15+ ReactDOM . unmountComponentAtNode ( div ) ;
16+ } ) ;
17+ it ( 'renders nothing when no country code is supplied' , async ( ) => {
18+ const div = document . createElement ( 'div' ) ;
19+ ReactDOM . render ( < Flag country = "" alt = "Testing" /> , div ) ;
20+ expect ( div . innerHTML . length ) . toBe ( 0 ) ;
21+ ReactDOM . unmountComponentAtNode ( div ) ;
22+ } ) ;
23+ } ) ;
You can’t perform that action at this time.
0 commit comments