Skip to content
This repository was archived by the owner on May 24, 2024. It is now read-only.

Commit 1b43992

Browse files
author
Brett Jankord
committed
Clean up jest tests
1 parent b63c469 commit 1b43992

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
import React from 'react';
22
import Base from '../../src/Base';
33

4+
// Missing locale test
5+
it('throws error for missing required locale', () => {
6+
const messages = { Terra: 'Terra' };
7+
8+
try {
9+
shallow(<Base customMessages={messages}>String</Base>);
10+
} catch (e) {
11+
expect(e.message).toContain('Missing locale prop');
12+
}
13+
});
14+
415
// Snapshot Tests
5-
it('should support rendering a string without translation', () => {
16+
it('should support rendering a string', () => {
617
const base = shallow(<Base>String</Base>);
718
expect(base).toMatchSnapshot();
819
});
920

10-
it('should support rendering an array of children without translation', () => {
21+
it('should support rendering an array of children', () => {
1122
/* eslint-disable comma-dangle */
1223
const base = shallow(
1324
<Base>
@@ -19,18 +30,7 @@ it('should support rendering an array of children without translation', () => {
1930
/* eslint-enable comma-dangle */
2031
});
2132

22-
// Snapshot Tests
23-
it('should render with stict mode when strict mode enabled', () => {
33+
it('should render with strict mode when strict mode enabled', () => {
2434
const base = shallow(<Base strictMode>String</Base>);
2535
expect(base).toMatchSnapshot();
2636
});
27-
28-
it('throws error for missing required locale', () => {
29-
const messages = { Terra: 'Terra' };
30-
31-
try {
32-
shallow(<Base customMessages={messages}>String</Base>);
33-
} catch (e) {
34-
expect(e.message).toContain('Missing locale prop');
35-
}
36-
});

0 commit comments

Comments
 (0)