Skip to content

Commit 3e3b7fb

Browse files
committed
Reimport testing
1 parent 0f3d3f5 commit 3e3b7fb

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

test/blah.test.tsx

Lines changed: 0 additions & 11 deletions
This file was deleted.

test/flag.test.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
});

0 commit comments

Comments
 (0)